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:
parent
a6d372b961
commit
99c6b8bf45
1 changed files with 4 additions and 3 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue