Sha256: 18bcf7e879d0df992d7cc850c760d49d2e08dc7a04d93ff17eb411e73192fe8f

Contents?: true

Size: 1.34 KB

Versions: 10

Compression:

Stored size: 1.34 KB

Contents

require 'rails_helper'

# Specs in this file have access to a helper object that includes
# the PatronsHelper. For example:
#
# describe PatronsHelper do
#   describe "string concat" do
#     it "concats two strings with spaces" do
#       helper.concat_strings("this","that").should == "this that"
#     end
#   end
# end
describe EnjuManifestationViewer::BookJacketHelper do
  fixtures :all

  it "should get screenshot", :vcr => true do
    helper.screenshot_tag(manifestations(:manifestation_00003)).should =~ /<a href=\"http:\/\/www.slis.keio.ac.jp\/\">/
  end

  it "should get book jacket" do
    helper.book_jacket_tag(manifestations(:manifestation_00001)).should =~ /<div id=\"gbsthumbnail1\" class=\"book_jacket\"><\/div>/
  end

  it "should generate a link to Amazon" do
    helper.amazon_link(manifestations(:manifestation_00001).identifier_contents(:isbn).first).should =~ /http:\/\/www.amazon.co.jp\/dp\/4798002062/
  end

  it "should get honmoto.com book jacket" do
    html = helper.book_jacket_tag(manifestations(:manifestation_00001), "hanmotocom")
    expect(html).to have_selector 'img[src="http://www.hanmoto.com/bd/img/9784798002064.jpg"]'
  end

  it "should get openbd book jacket" do
    helper.book_jacket_tag(manifestations(:manifestation_00001), "openbd").should =~ /<div id=\"openbd_thumbnail1\" class=\"book_jacket\"><\/div>/
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
enju_manifestation_viewer-0.3.2 spec/helpers/book_jacket_helper_spec.rb
enju_manifestation_viewer-0.3.1 spec/helpers/book_jacket_helper_spec.rb
enju_manifestation_viewer-0.3.0 spec/helpers/book_jacket_helper_spec.rb
enju_manifestation_viewer-0.3.0.rc.1 spec/helpers/book_jacket_helper_spec.rb
enju_manifestation_viewer-0.3.0.beta.2 spec/helpers/book_jacket_helper_spec.rb
enju_manifestation_viewer-0.3.0.beta.1 spec/helpers/book_jacket_helper_spec.rb
enju_manifestation_viewer-0.2.4 spec/helpers/book_jacket_helper_spec.rb
enju_manifestation_viewer-0.2.3 spec/helpers/book_jacket_helper_spec.rb
enju_manifestation_viewer-0.2.2 spec/helpers/book_jacket_helper_spec.rb
enju_manifestation_viewer-0.2.1 spec/helpers/book_jacket_helper_spec.rb