Make LikesController spec a bit more specific
This commit is contained in:
parent
cba63030c9
commit
dd67107ab1
1 changed files with 19 additions and 18 deletions
|
|
@ -73,7 +73,6 @@ describe LikesController do
|
|||
end
|
||||
|
||||
describe '#destroy' do
|
||||
context 'your like' do
|
||||
before do
|
||||
@message = bob.post(:status_message, :text => "hey", :to => @aspect1.id)
|
||||
@like = alice.build_like(:positive => true, :post => @message)
|
||||
|
|
@ -84,6 +83,7 @@ describe LikesController do
|
|||
expect {
|
||||
delete :destroy, :format => "js", :post_id => @like.post_id, :id => @like.id
|
||||
}.should change(Like, :count).by(-1)
|
||||
response.status.should == 200
|
||||
end
|
||||
|
||||
it 'does not let a user destroy other likes' do
|
||||
|
|
@ -93,7 +93,8 @@ describe LikesController do
|
|||
expect {
|
||||
delete :destroy, :format => "js", :post_id => like2.post_id, :id => like2.id
|
||||
}.should_not change(Like, :count)
|
||||
end
|
||||
|
||||
response.status.should == 403
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue