diff --git a/lib/locomotive/liquid/filters/resize.rb b/lib/locomotive/liquid/filters/resize.rb index 0672ed52..3d499a12 100644 --- a/lib/locomotive/liquid/filters/resize.rb +++ b/lib/locomotive/liquid/filters/resize.rb @@ -13,4 +13,4 @@ module Locomotive end end -end \ No newline at end of file +end diff --git a/spec/lib/locomotive/liquid/filters/resize_spec.rb b/spec/lib/locomotive/liquid/filters/resize_spec.rb index 880ed397..8ef3097b 100644 --- a/spec/lib/locomotive/liquid/filters/resize_spec.rb +++ b/spec/lib/locomotive/liquid/filters/resize_spec.rb @@ -1,7 +1,6 @@ require 'spec_helper' describe Locomotive::Liquid::Filters::Resize do - before :each do @site = FactoryGirl.create(:site) @theme_asset = FactoryGirl.create(:theme_asset, :source => FixturedAsset.open('5k.png'), :site => @site) @@ -10,13 +9,10 @@ describe Locomotive::Liquid::Filters::Resize do @asset_url = @asset.source.url @asset_path = "/sites/#{@asset.site_id}/assets/#{@asset.id}/5k.png" @context = Liquid::Context.new( { }, { 'asset_url' => @asset_url, 'theme_asset' => @theme_asset.to_liquid }, { :site => @site }) - @app = Locomotive::Dragonfly.app end describe '#resize' do - context 'when an asset url string is given' do - before :each do @template = Liquid::Template.parse('{{ asset_url | resize: "40x30" }}') end @@ -26,13 +22,11 @@ describe Locomotive::Liquid::Filters::Resize do end it 'should use the path in the public folder to generate a location' do - @template.render(@context).should == @app.fetch_file("public#{@asset_path}").thumb('40x30').url + @template.render(@context).should == Locomotive::Dragonfly.resize_url(@asset_path, '40x30') end - end context 'when a theme asset is given' do - before :each do @template = Liquid::Template.parse("{{ theme_asset | resize: '300x400' }}") end @@ -42,13 +36,11 @@ describe Locomotive::Liquid::Filters::Resize do end it 'should use the path of the theme asset to generate a location' do - @template.render(@context).should == @app.fetch_file("public#{@theme_asset_path}").thumb('300x400').url + @template.render(@context).should == Locomotive::Dragonfly.resize_url(@theme_asset_path, '300x400') end - end context 'when no resize string is given' do - before :each do @template = Liquid::Template.parse('{{ asset | resize: }}') end @@ -56,9 +48,6 @@ describe Locomotive::Liquid::Filters::Resize do it 'should return a liquid error' do @template.render(@context).should include 'Liquid error: wrong number of arguments' end - end - end - -end \ No newline at end of file +end