Skip to content

Commit 3b4a499

Browse files
committed
tests/acceptance/crate: Use "crate" and "version" factories instead of fixtures
1 parent 663908f commit 3b4a499

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

tests/acceptance/crate-test.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import hasText from 'cargo/tests/helpers/has-text';
66
moduleForAcceptance('Acceptance | crate page');
77

88
test('visiting a crate page from the front page', async function(assert) {
9-
server.loadFixtures();
9+
server.create('crate', 'withVersion', { id: 'nanomsg' });
1010

1111
await visit('/');
1212
await click('#just-updated ul > li:first a');
@@ -16,7 +16,9 @@ test('visiting a crate page from the front page', async function(assert) {
1616
});
1717

1818
test('visiting /crates/nanomsg', async function(assert) {
19-
server.loadFixtures();
19+
server.create('crate', { id: 'nanomsg', max_version: '0.6.1' });
20+
server.create('version', { crate: 'nanomsg', num: '0.6.0' });
21+
server.create('version', { crate: 'nanomsg', num: '0.6.1' });
2022

2123
await visit('/crates/nanomsg');
2224

@@ -29,7 +31,9 @@ test('visiting /crates/nanomsg', async function(assert) {
2931
});
3032

3133
test('visiting /crates/nanomsg/', async function(assert) {
32-
server.loadFixtures();
34+
server.create('crate', { id: 'nanomsg', max_version: '0.6.1' });
35+
server.create('version', { crate: 'nanomsg', num: '0.6.0' });
36+
server.create('version', { crate: 'nanomsg', num: '0.6.1' });
3337

3438
await visit('/crates/nanomsg/');
3539

@@ -42,7 +46,9 @@ test('visiting /crates/nanomsg/', async function(assert) {
4246
});
4347

4448
test('visiting /crates/nanomsg/0.6.0', async function(assert) {
45-
server.loadFixtures();
49+
server.create('crate', { id: 'nanomsg', max_version: '0.6.1' });
50+
server.create('version', { crate: 'nanomsg', num: '0.6.0' });
51+
server.create('version', { crate: 'nanomsg', num: '0.6.1' });
4652

4753
await visit('/crates/nanomsg/0.6.0');
4854

0 commit comments

Comments
 (0)