registering swfobject as a default javascript library
This commit is contained in:
parent
dd8541c232
commit
3d8bc2bff6
1
init.rb
1
init.rb
@ -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
|
||||||
|
@ -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>' +
|
||||||
|
Loading…
Reference in New Issue
Block a user