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
it 'lets a user destroy their like' do
expect {
delete :destroy, :format => :json, id_field => @like.target_id, :id => @like.id
}.should change(Like, :count).by(-1)
current_user = controller.send(:current_user)
current_user.should_receive(:retract).with(@like)
delete :destroy, :format => :json, id_field => @like.target_id, :id => @like.id
response.status.should == 204
end