mirror of
https://github.com/discourse/discourse.git
synced 2026-08-14 06:55:03 -05:00
BUGFIXES: properly deal with bookmarks and deleted posts
BUGFIX: removing a bookmark from the activity feed was busted for deleted posts BUGFIX: delete associated user actions when deleting a post
This commit is contained in:
@@ -288,13 +288,10 @@ describe PostsController do
|
||||
let(:post) { Fabricate(:post, user: log_in) }
|
||||
|
||||
it "raises an error if the user doesn't have permission to see the post" do
|
||||
Guardian.any_instance.expects(:can_see?).with(post).returns(false).twice
|
||||
Guardian.any_instance.expects(:can_see?).with(post).returns(false).once
|
||||
|
||||
xhr :put, :bookmark, post_id: post.id, bookmarked: 'true'
|
||||
response.should be_forbidden
|
||||
|
||||
xhr :put, :remove_bookmark_by_number, topic_id: post.topic_id, post_number: post.post_number
|
||||
response.should be_forbidden
|
||||
end
|
||||
|
||||
it 'creates a bookmark' do
|
||||
@@ -307,11 +304,6 @@ describe PostsController do
|
||||
xhr :put, :bookmark, post_id: post.id
|
||||
end
|
||||
|
||||
it 'removes a bookmark using the topic_id and the post_number' do
|
||||
PostAction.expects(:remove_act).with(post.user, post, PostActionType.types[:bookmark])
|
||||
xhr :put, :remove_bookmark_by_number, topic_id: post.topic_id, post_number: post.post_number
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user