mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Minor bookmark with reminder issue cleanup (#9436)
* Count user summary bookmarks from new Bookmark table if bookmarks with reminders enabled * Update topic user bookmarked column when new topic bookmark changed * Make in:bookmarks search work with new bookmarks * Fix batch inserts for bookmark rake task (and thus migration). We were only inserting one bookmark at a time, completely defeating the purpose of batching!
This commit is contained in:
@@ -32,6 +32,14 @@ RSpec.describe BookmarkManager do
|
||||
end
|
||||
end
|
||||
|
||||
context "when bookmarking the topic level (post is OP)" do
|
||||
it "updates the topic user bookmarked column to true" do
|
||||
subject.create(post_id: post.id, name: name, reminder_type: reminder_type, reminder_at: reminder_at)
|
||||
tu = TopicUser.find_by(user: user)
|
||||
expect(tu.bookmarked).to eq(true)
|
||||
end
|
||||
end
|
||||
|
||||
context "when the reminder type is at_desktop" do
|
||||
let(:reminder_type) { 'at_desktop' }
|
||||
let(:reminder_at) { nil }
|
||||
@@ -188,6 +196,12 @@ RSpec.describe BookmarkManager do
|
||||
end
|
||||
end
|
||||
|
||||
it "updates the topic user bookmarked column to false" do
|
||||
TopicUser.create(user: user, topic: topic, bookmarked: true)
|
||||
subject.destroy_for_topic(topic)
|
||||
tu = TopicUser.find_by(user: user)
|
||||
expect(tu.bookmarked).to eq(false)
|
||||
end
|
||||
end
|
||||
|
||||
describe ".send_reminder_notification" do
|
||||
|
||||
Reference in New Issue
Block a user