@@ -1629,6 +1629,28 @@ class MaterialsControllerTest < ActionController::TestCase
16291629 end
16301630 end
16311631
1632+ test 'should display non-trainer contributor with linked ORCID' do
1633+ jc = profiles ( :trainer_one_profile )
1634+ jc . update! ( public : false , website : nil , image_url : nil )
1635+ jc = Profile . find ( jc . id )
1636+ assert @material . update ( authors : [ { name : 'John Doe' } ,
1637+ { name : 'Jane Smith' , orcid : '0000-0001-9999-9990' } ] ,
1638+ contributors : [ { name : 'Jos Ca' , orcid : '0000-0002-1825-0097' } ] )
1639+
1640+ get :show , params : { id : @material . id }
1641+
1642+ assert_select '.authors' , text : 'Authors: John Doe, Jane Smith'
1643+ assert_select '.authors a' , count : 1 do
1644+ assert_select '[href=?]' , 'https://orcid.org/0000-0001-9999-9990'
1645+ end
1646+
1647+ assert_select '.contributors' , { text : 'Contributors: Josiah Carberry' } ,
1648+ "Should use name from person's profile, if linked"
1649+ assert_select '.contributors a' , count : 1 do
1650+ assert_select '[href=?]' , user_path ( jc . user )
1651+ end
1652+ end
1653+
16321654 test 'should update material authors using structured authors' do
16331655 sign_in @material . user
16341656 update = @updated_material . merge ( authors : [
0 commit comments