spec/fields/note_spec.rb in mods_display-0.2.4 vs spec/fields/note_spec.rb in mods_display-0.3.0
- old
+ new
@@ -13,20 +13,20 @@
@type_label = Stanford::Mods::Record.new.from_str("<mods><note type='some other Type'>Note Field</note></mods>", false).note
@complex_label = Stanford::Mods::Record.new.from_str("<mods><note>Note Field</note><note>2nd Note Field</note><note type='statement of responsibility'>SoR</note><note>Another Note</note></mods>", false).note
end
describe "label" do
it "should have a default label" do
- mods_display_note(@note).fields.first.label.should == "Note"
+ mods_display_note(@note).fields.first.label.should == "Note:"
end
it "should use the displayLabel attribute when one is available" do
- mods_display_note(@display_label).fields.first.label.should == "Special Label"
+ mods_display_note(@display_label).fields.first.label.should == "Special Label:"
end
it "should use get a label from a list of translations" do
- mods_display_note(@sor_label).fields.first.label.should == "Statement of responsibility"
+ mods_display_note(@sor_label).fields.first.label.should == "Statement of responsibility:"
end
it "should use use the capitalized type attribute if one is present" do
- mods_display_note(@type_label).fields.first.label.should == "Some other type"
+ mods_display_note(@type_label).fields.first.label.should == "Some other type:"
end
end
describe "fields" do
it "should handle single values" do
@@ -35,18 +35,18 @@
fields.first.values.should == ["Note Field"]
end
it "should handle complex grouping" do
fields = mods_display_note(@complex_label).fields
fields.length.should == 3
- fields.first.label.should == "Note"
+ fields.first.label.should == "Note:"
fields.first.values.length == 2
fields.first.values.should == ["Note Field", "2nd Note Field"]
fields[1].label == "Statement of responsibility"
fields[1].values.length == 1
fields[1].values.should == ["SoR"]
- fields.last.label.should == "Note"
+ fields.last.label.should == "Note:"
fields.last.values.length == 1
fields.last.values.should == ["Another Note"]
end
it "should not include any contact fields" do
fields = mods_display_note(@contact_note).fields
\ No newline at end of file