Commit 9bcc8866
Changed files (1)
spec
controllers
spec/controllers/photos_controller_spec.rb
@@ -10,14 +10,19 @@ describe PhotosController do
end
describe "POST create" do
+ let(:image) { Rack::Test::UploadedFile.new("spec/support/gorilla.jpg", "image/jpeg") }
+
before :each do
- post :create, :creation_id => creation.id, :photo => { :image => [] }
+ post :create, :creation_id => creation.id, :photo => { :image => image }
end
- pending "returns http success" do
+
+ it "returns http success" do
response.should be_success
end
+
it "should upload a new photo" do
assigns(:photo).should_not be_nil
+ assigns(:photo).image.to_s.should include("gorilla.png")
end
end
@@ -27,13 +32,13 @@ describe PhotosController do
creation.stub(:photos).and_return(photo)
delete :destroy, :creation_id => creation.id, :id => 88
end
- pending "returns http success" do
+ xit "returns http success" do
response.should be_success
end
- pending "should destroy the photo" do
+ xit "should destroy the photo" do
photo.should have_received(:destroy)
end
- pending "should redirect to the creation" do
+ xit "should redirect to the creation" do
end
end