Skip to content

Commit 6f84ff4

Browse files
authored
chore(api-keys): add last_used_at field to list fixtures (#161)
1 parent 9e0fa51 commit 6f84ff4

1 file changed

Lines changed: 22 additions & 4 deletions

File tree

spec/api_keys_spec.rb

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,21 @@
4545
{
4646
"id":"6e3c3d83-05dc-4b51-acfc-fe8972738bd0",
4747
"name":"test1",
48-
"created_at":"2023-04-21T01:31:02.671414+00:00"
48+
"created_at":"2023-04-21T01:31:02.671414+00:00",
49+
"last_used_at":"2023-04-22T10:00:00.000000+00:00"
50+
},
51+
{
52+
"id":"7f4d4e94-16ed-5c62-bdfd-gf9083849ce1",
53+
"name":"test2",
54+
"created_at":"2023-04-21T01:31:02.671414+00:00",
55+
"last_used_at":nil
4956
}
5057
]
5158
}
5259
allow_any_instance_of(Resend::Request).to receive(:perform).and_return(resp)
53-
expect(Resend::ApiKeys.list.length).to eql(1)
60+
expect(Resend::ApiKeys.list[:data].length).to eql(2)
61+
expect(Resend::ApiKeys.list[:data].first[:last_used_at]).to eql("2023-04-22T10:00:00.000000+00:00")
62+
expect(Resend::ApiKeys.list[:data].last[:last_used_at]).to be_nil
5463
end
5564
end
5665

@@ -106,12 +115,21 @@
106115
{
107116
"id":"6e3c3d83-05dc-4b51-acfc-fe8972738bd0",
108117
"name":"test1",
109-
"created_at":"2023-04-21T01:31:02.671414+00:00"
118+
"created_at":"2023-04-21T01:31:02.671414+00:00",
119+
"last_used_at":"2023-04-22T10:00:00.000000+00:00"
120+
},
121+
{
122+
"id":"7f4d4e94-16ed-5c62-bdfd-gf9083849ce1",
123+
"name":"test2",
124+
"created_at":"2023-04-21T01:31:02.671414+00:00",
125+
"last_used_at":nil
110126
}
111127
]
112128
}
113129
allow_any_instance_of(Resend::Request).to receive(:perform).and_return(resp)
114-
expect(Resend::ApiKeys.list.length).to eql(1)
130+
expect(Resend::ApiKeys.list[:data].length).to eql(2)
131+
expect(Resend::ApiKeys.list[:data].first[:last_used_at]).to eql("2023-04-22T10:00:00.000000+00:00")
132+
expect(Resend::ApiKeys.list[:data].last[:last_used_at]).to be_nil
115133
end
116134
end
117135

0 commit comments

Comments
 (0)