Permalink
Browse files

couple more test fixes without the library extension muddling retriev…

…al order
  • Loading branch information...
1 parent 2b69e84 commit 3ea1770867a910a6ffd74c2188b6d9eec172fa15 @will-r will-r committed Sep 7, 2011
Showing with 5 additions and 5 deletions.
  1. +1 −2 app/models/asset.rb
  2. +3 −3 spec/lib/asset_tags_spec.rb
  3. +1 −0 spec/spec.opts
View
@@ -60,8 +60,6 @@ class Asset < ActiveRecord::Base
end
validates_attachment_size :asset, :less_than => ( Radiant.config["assets.max_asset_size"] || 5 ).to_i.megabytes
- @geometry ||= {}
-
def asset_type
AssetType.for(asset)
end
@@ -104,6 +102,7 @@ def original_geometry
end
def geometry(style_name='original')
+ @geometry ||= {}
@geometry[style_name] ||= if style_name.to_s == 'original'
original_geometry
elsif style = self.asset.styles[style_name.to_sym] # self.asset.styles holds Style objects, where self.paperclip_styles is still just rule hashes
@@ -3,7 +3,7 @@
describe AssetTags do
dataset :assets
let(:page) { pages(:pictured) }
- let(:asset) { assets(:test2) }
+ let(:asset) { assets(:test1) }
context "Asset tags" do
%w{width height caption asset_file_name asset_content_type asset_file_size id filename image flash url link extension page:title page:url}.each do |name|
@@ -31,11 +31,11 @@
end
it "assets:each" do
- page.should render('<r:assets:each><r:asset:id />,</r:assets:each>').as( "#{asset_id(:test2)},#{asset_id(:test1)}," )
+ page.should render('<r:assets:each><r:asset:id />,</r:assets:each>').as( "#{asset_id(:test1)},#{asset_id(:test2)}," )
end
it "assets:first" do
- page.should render('<r:assets:first><r:asset:id /></r:assets:first>').as( "#{asset_id(:test2)}" )
+ page.should render('<r:assets:first><r:asset:id /></r:assets:first>').as( asset.id.to_s )
end
it "should retrieve an asset by name" do
View
@@ -4,3 +4,4 @@ progress
--loadby
mtime
--reverse
+--backtrace

0 comments on commit 3ea1770

Please sign in to comment.