spec/fields/location_spec.rb in mods_display-0.2.4 vs spec/fields/location_spec.rb in mods_display-0.3.0
- old
+ new
@@ -11,33 +11,33 @@
@display_label = Stanford::Mods::Record.new.from_str("<mods><location displayLabel='Special Label'><shelfLocation>On Shelf A</shelfLocation></location></mods>", false).location
@repository_label = Stanford::Mods::Record.new.from_str("<mods><location><physicalLocation type='repository'>Location Field</physicalLocation></location></mods>", false).location
end
describe "label" do
it "should have a default label" do
- mods_display_location(@location).fields.first.label.should == "Location"
+ mods_display_location(@location).fields.first.label.should == "Location:"
end
it "should use the displayLabel attribute when one is available" do
- mods_display_location(@display_label).fields.first.label.should == "Special Label"
+ mods_display_location(@display_label).fields.first.label.should == "Special Label:"
end
it "should handle the URL labels correctly" do
- mods_display_location(@urls).fields.map{|f| f.label}.should == ["Location", "PURL"]
+ mods_display_location(@urls).fields.map{|f| f.label}.should == ["Location:", "PURL:"]
end
it "should use get a label from a list of translations" do
- mods_display_location(@repository_label).fields.first.label.should == "Repository"
+ mods_display_location(@repository_label).fields.first.label.should == "Repository:"
end
end
describe "fields" do
describe "URLs" do
it "should link and use the displayLabel as text" do
fields = mods_display_location(@urls).fields
fields.length.should == 2
- field = fields.find{|f| f.label == "Location"}
+ field = fields.find{|f| f.label == "Location:"}
field.values.should == ["<a href='http://library.stanford.edu'>Stanford University Library</a>"]
end
it "should link the URL itself in the absence of a displayLabel on the url element" do
fields = mods_display_location(@urls).fields
fields.length.should == 2
- field = fields.find{|f| f.label == "PURL"}
+ field = fields.find{|f| f.label == "PURL:"}
field.values.should == ["<a href='http://purl.stanford.edu'>http://purl.stanford.edu</a>"]
end
end
end
end
\ No newline at end of file