Skip to content

Commit 70ad207

Browse files
committed
tests/routes/crate/version/crate-links: Migrate from mirage to @crates-io/msw
1 parent a323f34 commit 70ad207

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

tests/routes/crate/version/crate-links-test.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ import { module, test } from 'qunit';
44
import { setupApplicationTest } from 'crates-io/tests/helpers';
55

66
module('Route | crate.version | crate links', function (hooks) {
7-
setupApplicationTest(hooks);
7+
setupApplicationTest(hooks, { msw: true });
88

99
test('shows all external crate links', async function (assert) {
10-
let crate = this.server.create('crate', {
10+
let crate = this.db.crate.create({
1111
name: 'foo',
1212
homepage: 'https://crates.io/',
1313
documentation: 'https://doc.rust-lang.org/cargo/getting-started/',
1414
repository: 'https://github.com/rust-lang/crates.io.git',
1515
});
16-
this.server.create('version', { crate, num: '1.0.0' });
16+
this.db.version.create({ crate, num: '1.0.0' });
1717

1818
await visit('/crates/foo');
1919

@@ -31,8 +31,8 @@ module('Route | crate.version | crate links', function (hooks) {
3131
});
3232

3333
test('shows no external crate links if none are set', async function (assert) {
34-
let crate = this.server.create('crate', { name: 'foo' });
35-
this.server.create('version', { crate, num: '1.0.0' });
34+
let crate = this.db.crate.create({ name: 'foo' });
35+
this.db.version.create({ crate, num: '1.0.0' });
3636

3737
await visit('/crates/foo');
3838

@@ -42,12 +42,12 @@ module('Route | crate.version | crate links', function (hooks) {
4242
});
4343

4444
test('hide the homepage link if it is the same as the repository', async function (assert) {
45-
let crate = this.server.create('crate', {
45+
let crate = this.db.crate.create({
4646
name: 'foo',
4747
homepage: 'https://github.com/rust-lang/crates.io',
4848
repository: 'https://github.com/rust-lang/crates.io',
4949
});
50-
this.server.create('version', { crate, num: '1.0.0' });
50+
this.db.version.create({ crate, num: '1.0.0' });
5151

5252
await visit('/crates/foo');
5353

@@ -61,12 +61,12 @@ module('Route | crate.version | crate links', function (hooks) {
6161
});
6262

6363
test('hide the homepage link if it is the same as the repository plus `.git`', async function (assert) {
64-
let crate = this.server.create('crate', {
64+
let crate = this.db.crate.create({
6565
name: 'foo',
6666
homepage: 'https://github.com/rust-lang/crates.io/',
6767
repository: 'https://github.com/rust-lang/crates.io.git',
6868
});
69-
this.server.create('version', { crate, num: '1.0.0' });
69+
this.db.version.create({ crate, num: '1.0.0' });
7070

7171
await visit('/crates/foo');
7272

0 commit comments

Comments
 (0)