Skip to content

Commit 8c7e929

Browse files
committed
Added tests for displaying the license based on version.
1 parent 4487d03 commit 8c7e929

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

mirage/factories/crate.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export default Factory.extend({
1414
documentation: () => faker.internet.url(),
1515
homepage: () => faker.internet.url(),
1616
repository: () => faker.internet.url(),
17-
license: () => faker.hacker.abbreviation(),
1817
max_version: () => faker.system.semver(),
1918

2019
created_at: () => faker.date.past(),

mirage/factories/version.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export default Factory.extend({
1313
},
1414

1515
yanked: false,
16+
license: () => faker.hacker.abbreviation(),
1617

1718
dl_path() {
1819
return `/api/v1/crates/${this.crate}/${this.num}/download`;

tests/acceptance/crate-test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,12 @@ test('crates having team-owners', async function(assert) {
119119
findWithAssert('ul.owners li:first a[href="/teams/github:org:thehydroimpulse"]');
120120
assert.equal(find('ul.owners li').length, 4);
121121
});
122+
123+
test('crates license is supplied by version', async function(assert) {
124+
server.loadFixtures();
125+
126+
await visit('/crates/nanomsg');
127+
hasText(assert, '.license', 'Apache-2.0');
128+
await click('#crate-versions a:contains("0.5.0")');
129+
hasText(assert, '.license', 'MIT/Apache-2.0');
130+
});

0 commit comments

Comments
 (0)