@@ -25,7 +25,18 @@ module('Mirage | Crates', function (hooks) {
25
25
26
26
test ( 'returns a paginated crates list' , async function ( assert ) {
27
27
this . server . create ( 'crate' , { name : 'rand' } ) ;
28
- this . server . create ( 'version' , { crateId : 'rand' , num : '1.0.0' } ) ;
28
+ this . server . create ( 'version' , {
29
+ crateId : 'rand' ,
30
+ created_at : '2020-11-06T12:34:56Z' ,
31
+ num : '1.0.0' ,
32
+ updated_at : '2020-11-06T12:34:56Z' ,
33
+ } ) ;
34
+ this . server . create ( 'version' , {
35
+ crateId : 'rand' ,
36
+ created_at : '2020-12-25T12:34:56Z' ,
37
+ num : '2.0.0-beta.1' ,
38
+ updated_at : '2020-12-25T12:34:56Z' ,
39
+ } ) ;
29
40
30
41
let response = await fetch ( '/api/v1/crates' ) ;
31
42
assert . equal ( response . status , 200 ) ;
@@ -50,12 +61,13 @@ module('Mirage | Crates', function (hooks) {
50
61
version_downloads : '/api/v1/crates/rand/downloads' ,
51
62
versions : '/api/v1/crates/rand/versions' ,
52
63
} ,
53
- max_version : '1.0.0' ,
64
+ max_version : '2.0.0-beta.1' ,
65
+ max_stable_version : '1.0.0' ,
54
66
name : 'rand' ,
55
- newest_version : '1 .0.0' ,
67
+ newest_version : '2 .0.0-beta.1 ' ,
56
68
repository : null ,
57
69
updated_at : '2017-02-24T12:34:56Z' ,
58
- versions : [ '1' ] ,
70
+ versions : [ '1' , '2' ] ,
59
71
} ,
60
72
] ,
61
73
meta : {
@@ -208,7 +220,7 @@ module('Mirage | Crates', function (hooks) {
208
220
209
221
test ( 'returns a crate object for known crates' , async function ( assert ) {
210
222
this . server . create ( 'crate' , { name : 'rand' } ) ;
211
- this . server . create ( 'version' , { crateId : 'rand' , num : '1.0.0' } ) ;
223
+ this . server . create ( 'version' , { crateId : 'rand' , num : '1.0.0-beta.1 ' } ) ;
212
224
213
225
let response = await fetch ( '/api/v1/crates/rand' ) ;
214
226
assert . equal ( response . status , 200 ) ;
@@ -233,9 +245,10 @@ module('Mirage | Crates', function (hooks) {
233
245
version_downloads : '/api/v1/crates/rand/downloads' ,
234
246
versions : '/api/v1/crates/rand/versions' ,
235
247
} ,
236
- max_version : '1.0.0' ,
248
+ max_version : '1.0.0-beta.1' ,
249
+ max_stable_version : null ,
237
250
name : 'rand' ,
238
- newest_version : '1.0.0' ,
251
+ newest_version : '1.0.0-beta.1 ' ,
239
252
repository : null ,
240
253
updated_at : '2017-02-24T12:34:56Z' ,
241
254
versions : [ '1' ] ,
@@ -247,15 +260,15 @@ module('Mirage | Crates', function (hooks) {
247
260
crate : 'rand' ,
248
261
crate_size : 0 ,
249
262
created_at : '2010-06-16T21:30:45Z' ,
250
- dl_path : '/api/v1/crates/rand/1.0.0/download' ,
263
+ dl_path : '/api/v1/crates/rand/1.0.0-beta.1 /download' ,
251
264
downloads : 0 ,
252
265
license : 'MIT/Apache-2.0' ,
253
266
links : {
254
- authors : '/api/v1/crates/rand/1.0.0/authors' ,
255
- dependencies : '/api/v1/crates/rand/1.0.0/dependencies' ,
256
- version_downloads : '/api/v1/crates/rand/1.0.0/downloads' ,
267
+ authors : '/api/v1/crates/rand/1.0.0-beta.1 /authors' ,
268
+ dependencies : '/api/v1/crates/rand/1.0.0-beta.1 /dependencies' ,
269
+ version_downloads : '/api/v1/crates/rand/1.0.0-beta.1 /downloads' ,
257
270
} ,
258
- num : '1.0.0' ,
271
+ num : '1.0.0-beta.1 ' ,
259
272
updated_at : '2017-02-24T12:34:56Z' ,
260
273
yanked : false ,
261
274
} ,
0 commit comments