Sha256: 117eebf903c0b47c2a925ca27c7c91e203b0e34f4fff26a01e39ef01d8586c7f

Contents?: true

Size: 851 Bytes

Versions: 6

Compression:

Stored size: 851 Bytes

Contents

require "spec_helper"

def mods_display_contents(mods_record)
  ModsDisplay::Contents.new(mods_record, ModsDisplay::Configuration::Base.new, mock("controller"))
end

describe ModsDisplay::Contents do
  before(:all) do
    @contents = Stanford::Mods::Record.new.from_str("<mods><tableOfContents>Content Note</tableOfContents></mods>", false).tableOfContents
    @display_label = Stanford::Mods::Record.new.from_str("<mods><tableOfContents displayLabel='Special Label'>Content Note</tableOfContents></mods>", false).tableOfContents
  end
  describe "label" do
    it "should have a default label" do
      mods_display_contents(@contents).label.should == "Table of Contents"
    end
    it "should use the displayLabel attribute when one is available" do
      mods_display_contents(@display_label).label.should == "Special Label"
    end
  end  
  
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mods_display-0.0.1.beta6 spec/fields/contents_spec.rb
mods_display-0.0.1.beta5 spec/fields/contents_spec.rb
mods_display-0.0.1.beta4 spec/fields/contents_spec.rb
mods_display-0.0.1.beta3 spec/fields/contents_spec.rb
mods_display-0.0.1.beta2 spec/fields/contents_spec.rb
mods_display-0.0.1.beta1 spec/fields/contents_spec.rb