Skip to content

Commit 9b3ae7c

Browse files
committed
Ensure ORCIDs in test code are valid
1 parent 55e59f9 commit 9b3ae7c

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

test/controllers/materials_controller_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1620,14 +1620,14 @@ class MaterialsControllerTest < ActionController::TestCase
16201620

16211621
test 'should display material authors/contributors appropriately' do
16221622
assert @material.update(authors: [{ name: 'John Doe' },
1623-
{ name: 'Jane Smith', orcid: '0000-0002-1234-5678' }],
1623+
{ name: 'Jane Smith', orcid: '0000-0001-9999-9990' }],
16241624
contributors: [{ name: 'Jos Ca', orcid: '0000-0002-1825-0097' }])
16251625

16261626
get :show, params: { id: @material.id }
16271627

16281628
assert_select '.authors', text: 'Authors: John Doe, Jane Smith'
16291629
assert_select '.authors a', count: 1 do
1630-
assert_select '[href=?]', 'https://orcid.org/0000-0002-1234-5678'
1630+
assert_select '[href=?]', 'https://orcid.org/0000-0001-9999-9990'
16311631
end
16321632

16331633
assert_select '.contributors', { text: 'Contributors: Josiah Carberry' },

test/models/material_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ class MaterialTest < ActiveSupport::TestCase
158158

159159
test 'should set authors from array of hashes' do
160160
@material.authors = [
161-
{ name: 'John Doe', orcid: '0000-0001-1234-5678' },
161+
{ name: 'John Doe', orcid: '0000-0002-1825-0097' },
162162
{ name: 'Jane Smith' }
163163
]
164164
@material.save!
@@ -241,7 +241,7 @@ class MaterialTest < ActiveSupport::TestCase
241241

242242
test 'should set contributors from array of hashes' do
243243
@material.contributors = [
244-
{ name: 'John Doe', orcid: '0000-0001-1234-5678' },
244+
{ name: 'John Doe', orcid: '0000-0002-1825-0097' },
245245
{ name: 'Jane Smith' }
246246
]
247247
@material.save!

test/models/person_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class PersonTest < ActiveSupport::TestCase
5757
end
5858

5959
test 'should not link to profile if no matching orcid' do
60-
person = @material.authors.create(name: 'John Doe', orcid: '0000-0001-9999-9999')
60+
person = @material.authors.create(name: 'John Doe', orcid: '0000-0001-9999-9990')
6161
assert person.valid?
6262
assert_nil person.profile
6363
end

0 commit comments

Comments
 (0)