Skip to content

Commit dcd730d

Browse files
committed
Add a test visiting a crate page directly
1 parent 7da845b commit dcd730d

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

mirage/config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ export default function() {
2727

2828
this.get('/api/v1/crates/nanomsg', () => crateFixture);
2929
this.get('/api/v1/crates/nanomsg/versions', () => crateVersionsFixture);
30-
this.get('/api/v1/crates/nanomsg/0.4.2/authors', () => crateAuthorsFixture);
30+
this.get('/api/v1/crates/nanomsg/:version_num/authors', () => crateAuthorsFixture);
3131
this.get('/api/v1/crates/nanomsg/owners', () => crateOwnersFixture);
3232
this.get('/api/v1/crates/nanomsg/reverse_dependencies', () => crateReverseDependenciesFixture);
33-
this.get('/api/v1/crates/nanomsg/0.4.2/dependencies', () => crateDependenciesFixture);
33+
this.get('/api/v1/crates/nanomsg/:version_num/dependencies', () => crateDependenciesFixture);
3434
this.get('/api/v1/crates/nanomsg/downloads', () => crateDownloadsFixture);
3535
this.get('/api/v1/keywords/network', () => keywordFixture);
3636
}

tests/acceptance/crate-test.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,13 @@ test('visiting a crate page from the front page', function(assert) {
1111
assert.equal(currentURL(), '/crates/nanomsg');
1212
assert.equal(document.title, 'nanomsg - Cargo: packages for Rust');
1313
});
14-
});
14+
});
15+
16+
test('visiting a crate page directly', function(assert) {
17+
visit('/crates/nanomsg');
18+
19+
andThen(function() {
20+
assert.equal(currentURL(), '/crates/nanomsg');
21+
assert.equal(document.title, 'nanomsg - Cargo: packages for Rust');
22+
});
23+
});

0 commit comments

Comments
 (0)