FIX: Do not allow null options for bookmark manager

This commit is contained in:
Martin Brennan
2020-05-08 15:24:37 +00:00
parent e83dc75238
commit 22dffe6f69
2 changed files with 19 additions and 2 deletions

View File

@ -53,6 +53,17 @@ RSpec.describe BookmarkManager do
end
end
context "when options are provided with null values" do
let(:options) { { delete_when_reminder_sent: nil } }
it "saves defaults successfully" do
subject.create(post_id: post.id, name: name, options: options)
bookmark = Bookmark.find_by(user: user)
expect(bookmark.delete_when_reminder_sent).to eq(false)
end
end
context "when the bookmark already exists for the user & post" do
before do
Bookmark.create(post: post, user: user, topic: post.topic)