zoomifier/spec/zoomifier_helper_spec.rb

23 lines
635 B
Ruby

require File.dirname(__FILE__) + '/spec_helper'
require File.dirname(__FILE__) + '/../../../../config/environment'
require 'zoomifier_helper'
describe Zoomifier::ViewHelpers do
before(:all) do
ActionView::Base.send :include, Zoomifier::ViewHelpers
end
before(:each) do
@view = ActionView::Base.new
end
it "should respond to zoomify_image_tag" do
@view.should respond_to(:zoomify_image_tag)
end
it "should generate the zoomify markup" do
@view.zoomify_image_tag('foo.jpg', { :id => 'foo', :alt => 'Foo Bar' }).should ==
'<div id="foo"><img alt="Foo Bar" src="/images/foo.jpg" /></div>'
end
end