mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
FIX: Raise right response when post_action does not exist.
This commit is contained in:
parent
e4b9f72f9e
commit
304ace926e
2 changed files with 8 additions and 2 deletions
|
@ -448,6 +448,12 @@ describe PostsController do
|
|||
let(:post_action) { PostAction.act(user, post, PostActionType.types[:bookmark]) }
|
||||
let(:admin) { Fabricate(:admin) }
|
||||
|
||||
it "returns the right response when post is not bookmarked" do
|
||||
xhr :put, :bookmark, post_id: Fabricate(:post, user: user).id
|
||||
|
||||
expect(response.status).to eq(404)
|
||||
end
|
||||
|
||||
it 'should be able to remove a bookmark' do
|
||||
post_action
|
||||
xhr :put, :bookmark, post_id: post.id
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue