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:
Martin Brennan
2020-04-20 13:30:04 +10:00
committed by GitHub
parent c6b411f6c1
commit 344ef5226c
15 changed files with 192 additions and 105 deletions

View File

@ -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