mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 06:56:01 +08:00
FEATURE: Edit bookmark reminders from post and explicit delete button (#9455)
There is now an explicit "Delete Bookmark" button in the edit modal. A confirmation is shown before deleting. Along with this, when the bookmarked post icon is clicked the modal is now shown instead of just deleting the bookmark. Also, the "Delete Bookmark" button from the user bookmark list now confirms the action. Add a `d d` shortcut in the modal to delete the bookmark.
This commit is contained in:
@ -123,8 +123,15 @@ RSpec.describe BookmarkManager do
|
||||
describe ".destroy" do
|
||||
let!(:bookmark) { Fabricate(:bookmark, user: user, post: post) }
|
||||
it "deletes the existing bookmark" do
|
||||
subject.destroy(bookmark.id)
|
||||
result = subject.destroy(bookmark.id)
|
||||
expect(Bookmark.exists?(id: bookmark.id)).to eq(false)
|
||||
expect(result[:topic_bookmarked]).to eq(false)
|
||||
end
|
||||
|
||||
it "returns a value indicating whether there are still other bookmarks in the topic for the user" do
|
||||
Fabricate(:bookmark, user: user, post: Fabricate(:post, topic: post.topic))
|
||||
result = subject.destroy(bookmark.id)
|
||||
expect(result[:topic_bookmarked]).to eq(true)
|
||||
end
|
||||
|
||||
context "if the bookmark is belonging to some other user" do
|
||||
|
Reference in New Issue
Block a user