Some fixes for the content asset spec.

This commit is contained in:
Mario Visic 2011-11-20 22:52:20 +11:00
parent 75041ba21c
commit e21a40c157

View File

@ -7,18 +7,18 @@ describe Locomotive::ContentAsset do
describe 'attaching a file' do describe 'attaching a file' do
before(:each) do before(:each) do
ContentAsset.any_instance.stubs(:site_id).returns('test') Locomotive::ContentAsset.any_instance.stubs(:site_id).returns('test')
@asset = FactoryGirl.build(:asset) @asset = FactoryGirl.build(:asset)
end end
it 'should process picture' do it 'should process picture' do
@asset.source = FixturedContentAsset.open('5k.png') @asset.source = FixturedAsset.open('5k.png')
@asset.source.file.content_type.should_not be_nil @asset.source.file.content_type.should_not be_nil
@asset.image?.should be_true @asset.image?.should be_true
end end
it 'should get width and height from the image' do it 'should get width and height from the image' do
@asset.source = FixturedContentAsset.open('5k.png') @asset.source = FixturedAsset.open('5k.png')
@asset.width.should == 32 @asset.width.should == 32
@asset.height.should == 32 @asset.height.should == 32
end end
@ -28,7 +28,7 @@ describe Locomotive::ContentAsset do
describe 'vignette' do describe 'vignette' do
before(:each) do before(:each) do
@asset = FactoryGirl.build(:asset, :source => FixturedContentAsset.open('5k.png')) @asset = FactoryGirl.build(:asset, :source => FixturedAsset.open('5k.png'))
end end
it 'does not resize image smaller than 50x50' do it 'does not resize image smaller than 50x50' do