diff --git a/spec/kernel-4.7/example_poster_spec.rb b/spec/kernel-4.7/example_poster_spec.rb index dcc81e6..c1c5396 100644 --- a/spec/kernel-4.7/example_poster_spec.rb +++ b/spec/kernel-4.7/example_poster_spec.rb @@ -18,6 +18,6 @@ it 'has relatedIdentifier with relationType Other and relationTypeInformation' do related_identifier = doc.search("relatedIdentifiers/relatedIdentifier").first expect(related_identifier['relationType']).to eq('Other') - expect(related_identifier['relationTypeInformation']).to eq('is output of') + expect(related_identifier['relationTypeInformation']).to eq('was presented at') end end diff --git a/spec/kernel-4.7/example_presentation_spec.rb b/spec/kernel-4.7/example_presentation_spec.rb index 784cbb3..2369fe8 100644 --- a/spec/kernel-4.7/example_presentation_spec.rb +++ b/spec/kernel-4.7/example_presentation_spec.rb @@ -18,6 +18,6 @@ it 'has relatedIdentifier with relationType Other and relationTypeInformation' do related_identifier = doc.search("relatedIdentifiers/relatedIdentifier").first expect(related_identifier['relationType']).to eq('Other') - expect(related_identifier['relationTypeInformation']).to eq('is output of') + expect(related_identifier['relationTypeInformation']).to eq('was presented at') end end diff --git a/spec/kernel-4.7/other_spec.rb b/spec/kernel-4.7/other_spec.rb index 2fe3cb2..a50aa88 100644 --- a/spec/kernel-4.7/other_spec.rb +++ b/spec/kernel-4.7/other_spec.rb @@ -249,8 +249,28 @@ end end + describe "relatedIdentifier relatedIdentifierType" do + it 'RAiD' do + related_identifier = doc.search("relatedIdentifiers/relatedIdentifier").first + related_identifier["relatedIdentifierType"] = "RAiD" + element = doc.at("relatedIdentifiers/relatedIdentifier") + element.replace related_identifier.to_s + errors = xsd.validate(Nokogiri::XML(doc.to_xml)).map { |error| error.to_s } + expect(errors.length).to eq(0) + end + + it 'SWHID' do + related_identifier = doc.search("relatedIdentifiers/relatedIdentifier").first + related_identifier["relatedIdentifierType"] = "SWHID" + element = doc.at("relatedIdentifiers/relatedIdentifier") + element.replace related_identifier.to_s + errors = xsd.validate(Nokogiri::XML(doc.to_xml)).map { |error| error.to_s } + expect(errors.length).to eq(0) + end + end + describe 'relatedItem' do - it 'relatedItem with relationTypeInformation and relationType Other' do + it 'with relationTypeInformation and relationType Other' do related_item = doc.search("relatedItems/relatedItem").first related_item['relationType'] = 'Other' related_item['relationTypeInformation'] = 'is output of' @@ -261,6 +281,28 @@ end end + describe 'relatedItem relatedItemIdentifierType' do + it 'RAiD' do + related_item = doc.search("relatedItems/relatedItem").first + related_item_identifier = related_item.at("relatedItemIdentifier") + related_item_identifier['relatedItemIdentifierType'] = 'RAiD' + element = doc.at("relatedItems/relatedItem") + element.replace related_item.to_s + errors = xsd.validate(Nokogiri::XML(doc.to_xml)).map { |error| error.to_s } + expect(errors.length).to eq(0) + end + + it 'SWHID' do + related_item = doc.search("relatedItems/relatedItem").first + related_item_identifier = related_item.at("relatedItemIdentifier") + related_item_identifier['relatedItemIdentifierType'] = 'SWHID' + element = doc.at("relatedItems/relatedItem") + element.replace related_item.to_s + errors = xsd.validate(Nokogiri::XML(doc.to_xml)).map { |error| error.to_s } + expect(errors.length).to eq(0) + end + end + describe "description" do it 'empty descriptions tag' do element = doc.at("descriptions") diff --git a/spec/kernel-4/example_poster_spec.rb b/spec/kernel-4/example_poster_spec.rb index dcc81e6..c1c5396 100644 --- a/spec/kernel-4/example_poster_spec.rb +++ b/spec/kernel-4/example_poster_spec.rb @@ -18,6 +18,6 @@ it 'has relatedIdentifier with relationType Other and relationTypeInformation' do related_identifier = doc.search("relatedIdentifiers/relatedIdentifier").first expect(related_identifier['relationType']).to eq('Other') - expect(related_identifier['relationTypeInformation']).to eq('is output of') + expect(related_identifier['relationTypeInformation']).to eq('was presented at') end end diff --git a/spec/kernel-4/example_presentation_spec.rb b/spec/kernel-4/example_presentation_spec.rb index 784cbb3..2369fe8 100644 --- a/spec/kernel-4/example_presentation_spec.rb +++ b/spec/kernel-4/example_presentation_spec.rb @@ -18,6 +18,6 @@ it 'has relatedIdentifier with relationType Other and relationTypeInformation' do related_identifier = doc.search("relatedIdentifiers/relatedIdentifier").first expect(related_identifier['relationType']).to eq('Other') - expect(related_identifier['relationTypeInformation']).to eq('is output of') + expect(related_identifier['relationTypeInformation']).to eq('was presented at') end end diff --git a/spec/kernel-4/other_spec.rb b/spec/kernel-4/other_spec.rb index 2fe3cb2..a50aa88 100644 --- a/spec/kernel-4/other_spec.rb +++ b/spec/kernel-4/other_spec.rb @@ -249,8 +249,28 @@ end end + describe "relatedIdentifier relatedIdentifierType" do + it 'RAiD' do + related_identifier = doc.search("relatedIdentifiers/relatedIdentifier").first + related_identifier["relatedIdentifierType"] = "RAiD" + element = doc.at("relatedIdentifiers/relatedIdentifier") + element.replace related_identifier.to_s + errors = xsd.validate(Nokogiri::XML(doc.to_xml)).map { |error| error.to_s } + expect(errors.length).to eq(0) + end + + it 'SWHID' do + related_identifier = doc.search("relatedIdentifiers/relatedIdentifier").first + related_identifier["relatedIdentifierType"] = "SWHID" + element = doc.at("relatedIdentifiers/relatedIdentifier") + element.replace related_identifier.to_s + errors = xsd.validate(Nokogiri::XML(doc.to_xml)).map { |error| error.to_s } + expect(errors.length).to eq(0) + end + end + describe 'relatedItem' do - it 'relatedItem with relationTypeInformation and relationType Other' do + it 'with relationTypeInformation and relationType Other' do related_item = doc.search("relatedItems/relatedItem").first related_item['relationType'] = 'Other' related_item['relationTypeInformation'] = 'is output of' @@ -261,6 +281,28 @@ end end + describe 'relatedItem relatedItemIdentifierType' do + it 'RAiD' do + related_item = doc.search("relatedItems/relatedItem").first + related_item_identifier = related_item.at("relatedItemIdentifier") + related_item_identifier['relatedItemIdentifierType'] = 'RAiD' + element = doc.at("relatedItems/relatedItem") + element.replace related_item.to_s + errors = xsd.validate(Nokogiri::XML(doc.to_xml)).map { |error| error.to_s } + expect(errors.length).to eq(0) + end + + it 'SWHID' do + related_item = doc.search("relatedItems/relatedItem").first + related_item_identifier = related_item.at("relatedItemIdentifier") + related_item_identifier['relatedItemIdentifierType'] = 'SWHID' + element = doc.at("relatedItems/relatedItem") + element.replace related_item.to_s + errors = xsd.validate(Nokogiri::XML(doc.to_xml)).map { |error| error.to_s } + expect(errors.length).to eq(0) + end + end + describe "description" do it 'empty descriptions tag' do element = doc.at("descriptions")