registering swfobject as a default javascript library

This commit is contained in:
Donald Ball 2008-11-24 13:38:24 -06:00
parent dd8541c232
commit 3d8bc2bff6
2 changed files with 5 additions and 0 deletions

View File

@ -1,4 +1,5 @@
require 'zoomifier' require 'zoomifier'
require 'zoomifier_helper' require 'zoomifier_helper'
ActionView::Helpers::AssetTagHelper::register_javascript_include_default 'swfobject'
ActionView::Base.send :include, Zoomifier::ViewHelpers ActionView::Base.send :include, Zoomifier::ViewHelpers

View File

@ -15,6 +15,10 @@ describe Zoomifier::ViewHelpers do
@view.should respond_to(:zoomify_image_tag) @view.should respond_to(:zoomify_image_tag)
end end
it "should register swfobject.js as a default javascript library" do
@view.javascript_include_tag(:defaults).match(/"\/javascripts\/swfobject.js"/).should_not be_nil
end
it "should generate the zoomify markup" do it "should generate the zoomify markup" do
@view.zoomify_image_tag('foo.jpg', { :id => 'foo', :alt => 'Foo Bar', :width => 800, :height => 500 }).should == @view.zoomify_image_tag('foo.jpg', { :id => 'foo', :alt => 'Foo Bar', :width => 800, :height => 500 }).should ==
'<div id="foo"><img alt="Foo Bar" height="500" src="/images/foo.jpg" width="800" /></div>' + '<div id="foo"><img alt="Foo Bar" height="500" src="/images/foo.jpg" width="800" /></div>' +