photo specs pass

This commit is contained in:
maxwell 2011-03-17 10:35:03 -07:00
parent 82a79c95fe
commit 4e419f7d1a

View file

@ -13,8 +13,8 @@ describe Photo do
@fixture_name = File.join(File.dirname(__FILE__), '..', 'fixtures', @fixture_filename) @fixture_name = File.join(File.dirname(__FILE__), '..', 'fixtures', @fixture_filename)
@fail_fixture_name = File.join(File.dirname(__FILE__), '..', 'fixtures', 'msg.xml') @fail_fixture_name = File.join(File.dirname(__FILE__), '..', 'fixtures', 'msg.xml')
@photo = @user.post(:photo, :user_file=> File.open(@fixture_name), :to => @aspect.id) @photo = @user.build_post(:photo, :user_file=> File.open(@fixture_name), :to => @aspect.id)
@photo2 = @user.post(:photo, :user_file=> File.open(@fixture_name), :to => @aspect.id) @photo2 = @user.build_post(:photo, :user_file=> File.open(@fixture_name), :to => @aspect.id)
end end
describe "protected attributes" do describe "protected attributes" do
@ -35,12 +35,11 @@ describe Photo do
end end
end end
describe 'after create' do describe 'after_create' do
it 'calls #queue_processing_job' do it 'calls #queue_processing_job' do
p = Factory.build(:photo, :image => File.open(@fixture_name)) @photo.should_receive(:queue_processing_job)
p.should_receive(:queue_processing_job)
p.save! @photo.save!
end end
end end
@ -137,7 +136,7 @@ describe Photo do
describe 'remote photos' do describe 'remote photos' do
it 'should set the remote_photo on marshalling' do it 'should set the remote_photo on marshalling' do
@photo.image.store! File.open(@fixture_name) @photo.image.store! File.open(@fixture_name)
@photo.save
#security hax #security hax
user2 = Factory.create(:user) user2 = Factory.create(:user)
aspect2 = user2.aspects.create(:name => "foobars") aspect2 = user2.aspects.create(:name => "foobars")