mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: remove bookmark button in activity feed
This commit is contained in:
@@ -288,9 +288,13 @@ 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)
|
||||
Guardian.any_instance.expects(:can_see?).with(post).returns(false).twice
|
||||
|
||||
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
|
||||
@@ -303,6 +307,11 @@ 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