From 899d82b766e5ceea22b11f5cee5bf55684d1f6e5 Mon Sep 17 00:00:00 2001 From: Sarah Mei <sarahmei@gmail.com> Date: Fri, 8 Oct 2010 02:15:07 -0600 Subject: [PATCH] Fix 1 of 2 pending photo specs. --- spec/models/photo_spec.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/models/photo_spec.rb b/spec/models/photo_spec.rb index 2a4ac4991d..338e89933f 100644 --- a/spec/models/photo_spec.rb +++ b/spec/models/photo_spec.rb @@ -11,16 +11,16 @@ describe Photo do @album = @user.post :album, :name => "foo", :to => @aspect.id @fixture_filename = 'button.png' - @fixture_name = File.dirname(__FILE__) + '/../fixtures/button.png' - @fail_fixture_name = File.dirname(__FILE__) + '/../fixtures/msg.xml' + @fixture_name = File.join(File.dirname(__FILE__), '..', 'fixtures', @fixture_filename) + @fail_fixture_name = File.join(File.dirname(__FILE__), '..', 'fixtures', 'msg.xml') @photo = Photo.new(:person => @user.person, :album => @album) end - it 'should have a constructor' do - pending "Figure out how to make the photo posting api work in specs, it needs a file type" + it 'has a constructor' do image = File.open(@fixture_name) - photo = Photo.instantiate(:person => @user.person, :album => @album, :user_file => [image]) + photo = Photo.instantiate( + :person => @user.person, :album => @album, :user_file => image) photo.created_at.nil?.should be false photo.image.read.nil?.should be false end -- GitLab