don't test for actually deleted likes,

instead check whether the `retract` method was called, everything
else should be tested there.
This commit is contained in:
Florian Staudacher 2012-09-05 23:48:23 +02:00
parent a6d372b961
commit 99c6b8bf45

View file

@ -111,9 +111,10 @@ describe LikesController do
end end
it 'lets a user destroy their like' do it 'lets a user destroy their like' do
expect { current_user = controller.send(:current_user)
delete :destroy, :format => :json, id_field => @like.target_id, :id => @like.id current_user.should_receive(:retract).with(@like)
}.should change(Like, :count).by(-1)
delete :destroy, :format => :json, id_field => @like.target_id, :id => @like.id
response.status.should == 204 response.status.should == 204
end end