Sha256: 07f6e719e4dfd34e4994c556a1bbee331d3948f144ae600f3728be4bc7fc58f0

Contents?: true

Size: 983 Bytes

Versions: 11

Compression:

Stored size: 983 Bytes

Contents

require "spec_helper"

def html_from_mods(xml)
  model = TestModel.new
  model.modsxml = xml
  TestController.new.render_mods_display(model)
end

describe "HTML Output" do
  before(:all) do
    @multiple_titles = html_from_mods("<mods><titleInfo><title>Main Title</title></titleInfo><titleInfo type='alternative'><title>Alternate Title</title></titleInfo></mods>")
  end
  
  describe "titles" do
    it "should include both titles it regular display" do
      @multiple_titles.to_html.should include("<dd>Main Title</dd>")
      @multiple_titles.to_html.should include("<dd>Alternate Title</dd>")
    end
    it "should return just the first title in the #title method" do
      @multiple_titles.title.should == ["Main Title"]
    end
    it "should omit the first title and return any remaining titles in the #body" do
      @multiple_titles.body.should_not include("<dd>Main Title</dd>")
      @multiple_titles.body.should     include("<dd>Alternate Title</dd>")
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
mods_display-0.1.4 spec/integration/html_spec.rb
mods_display-0.1.3 spec/integration/html_spec.rb
mods_display-0.1.2 spec/integration/html_spec.rb
mods_display-0.1.1 spec/integration/html_spec.rb
mods_display-0.1.0 spec/integration/html_spec.rb
mods_display-0.0.5 spec/integration/html_spec.rb
mods_display-0.0.4 spec/integration/html_spec.rb
mods_display-0.0.3 spec/integration/html_spec.rb
mods_display-0.0.2 spec/integration/html_spec.rb
mods_display-0.0.1 spec/integration/html_spec.rb
mods_display-0.0.1.beta6 spec/integration/html_spec.rb