@@ -18,7 +18,7 @@ module('Route | crate.version | docs link', function (hooks) {
18
18
let crate = this . server . create ( 'crate' , { name : 'foo' } ) ;
19
19
this . server . create ( 'version' , { crate, num : '1.0.0' } ) ;
20
20
21
- this . server . get ( 'https://docs.rs/crate/:crate/:version/builds .json' , [ ] ) ;
21
+ this . server . get ( 'https://docs.rs/crate/:crate/:version/status .json' , 'not found' , 404 ) ;
22
22
23
23
await visit ( '/crates/foo' ) ;
24
24
assert . dom ( '[data-test-docs-link] a' ) . doesNotExist ( ) ;
@@ -28,16 +28,10 @@ module('Route | crate.version | docs link', function (hooks) {
28
28
let crate = this . server . create ( 'crate' , { name : 'foo' } ) ;
29
29
this . server . create ( 'version' , { crate, num : '1.0.0' } ) ;
30
30
31
- this . server . get ( 'https://docs.rs/crate/:crate/:version/builds.json' , [
32
- {
33
- id : 42 ,
34
- rustc_version : 'rustc 1.50.0-nightly (1c389ffef 2020-11-24)' ,
35
- docsrs_version : 'docsrs 0.6.0 (31c864e 2020-11-22)' ,
36
- build_status : true ,
37
- build_time : '2020-12-06T09:04:36.610302Z' ,
38
- output : null ,
39
- } ,
40
- ] ) ;
31
+ this . server . get ( 'https://docs.rs/crate/:crate/:version/status.json' , {
32
+ doc_status : true ,
33
+ version : '1.0.0' ,
34
+ } ) ;
41
35
42
36
await visit ( '/crates/foo' ) ;
43
37
assert . dom ( '[data-test-docs-link] a' ) . hasAttribute ( 'href' , 'https://docs.rs/foo/1.0.0' ) ;
@@ -47,7 +41,7 @@ module('Route | crate.version | docs link', function (hooks) {
47
41
let crate = this . server . create ( 'crate' , { name : 'foo' , documentation : 'https://docs.rs/foo/0.6.2' } ) ;
48
42
this . server . create ( 'version' , { crate, num : '1.0.0' } ) ;
49
43
50
- this . server . get ( 'https://docs.rs/crate/:crate/:version/builds .json' , [ ] ) ;
44
+ this . server . get ( 'https://docs.rs/crate/:crate/:version/status .json' , 'not found' , 404 ) ;
51
45
52
46
await visit ( '/crates/foo' ) ;
53
47
assert . dom ( '[data-test-docs-link] a' ) . hasAttribute ( 'href' , 'https://docs.rs/foo/0.6.2' ) ;
@@ -57,16 +51,10 @@ module('Route | crate.version | docs link', function (hooks) {
57
51
let crate = this . server . create ( 'crate' , { name : 'foo' , documentation : 'https://docs.rs/foo/0.6.2' } ) ;
58
52
this . server . create ( 'version' , { crate, num : '1.0.0' } ) ;
59
53
60
- this . server . get ( 'https://docs.rs/crate/:crate/:version/builds.json' , [
61
- {
62
- id : 42 ,
63
- rustc_version : 'rustc 1.50.0-nightly (1c389ffef 2020-11-24)' ,
64
- docsrs_version : 'docsrs 0.6.0 (31c864e 2020-11-22)' ,
65
- build_status : true ,
66
- build_time : '2020-12-06T09:04:36.610302Z' ,
67
- output : null ,
68
- } ,
69
- ] ) ;
54
+ this . server . get ( 'https://docs.rs/crate/:crate/:version/status.json' , {
55
+ doc_status : true ,
56
+ version : '1.0.0' ,
57
+ } ) ;
70
58
71
59
await visit ( '/crates/foo' ) ;
72
60
assert . dom ( '[data-test-docs-link] a' ) . hasAttribute ( 'href' , 'https://docs.rs/foo/1.0.0' ) ;
@@ -76,27 +64,17 @@ module('Route | crate.version | docs link', function (hooks) {
76
64
let crate = this . server . create ( 'crate' , { name : 'foo' , documentation : 'https://docs.rs/foo/0.6.2' } ) ;
77
65
this . server . create ( 'version' , { crate, num : '1.0.0' } ) ;
78
66
79
- this . server . get ( 'https://docs.rs/crate/:crate/:version/builds .json' , { } , 500 ) ;
67
+ this . server . get ( 'https://docs.rs/crate/:crate/:version/status .json' , 'error' , 500 ) ;
80
68
81
69
await visit ( '/crates/foo' ) ;
82
70
assert . dom ( '[data-test-docs-link] a' ) . hasAttribute ( 'href' , 'https://docs.rs/foo/0.6.2' ) ;
83
71
} ) ;
84
72
85
- test ( 'null builds in docs.rs responses are ignored' , async function ( assert ) {
73
+ test ( 'empty docs.rs responses are ignored' , async function ( assert ) {
86
74
let crate = this . server . create ( 'crate' , { name : 'foo' , documentation : 'https://docs.rs/foo/0.6.2' } ) ;
87
75
this . server . create ( 'version' , { crate, num : '0.6.2' } ) ;
88
76
89
- this . server . get ( 'https://docs.rs/crate/:crate/:version/builds.json' , [ null ] ) ;
90
-
91
- await visit ( '/crates/foo' ) ;
92
- assert . dom ( '[data-test-docs-link] a' ) . hasAttribute ( 'href' , 'https://docs.rs/foo/0.6.2' ) ;
93
- } ) ;
94
-
95
- test ( 'empty arrays in docs.rs responses are ignored' , async function ( assert ) {
96
- let crate = this . server . create ( 'crate' , { name : 'foo' , documentation : 'https://docs.rs/foo/0.6.2' } ) ;
97
- this . server . create ( 'version' , { crate, num : '0.6.2' } ) ;
98
-
99
- this . server . get ( 'https://docs.rs/crate/:crate/:version/builds.json' , [ ] ) ;
77
+ this . server . get ( 'https://docs.rs/crate/:crate/:version/status.json' , { } ) ;
100
78
101
79
await visit ( '/crates/foo' ) ;
102
80
assert . dom ( '[data-test-docs-link] a' ) . hasAttribute ( 'href' , 'https://docs.rs/foo/0.6.2' ) ;
0 commit comments