Set immediate notification mail to true by default

pull/11962/head
Oliver Günther 2 years ago
parent 9614093dbd
commit f15debf637
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 2
      app/models/user_preference.rb
  2. 3
      spec/features/notifications/reminder_mail_spec.rb
  3. 12
      spec/features/notifications/settings/immediate_reminder_spec.rb

@ -132,7 +132,7 @@ class UserPreference < ApplicationRecord
end
def immediate_reminders
super.presence || { mentioned: false }.with_indifferent_access
super.presence || { mentioned: true }.with_indifferent_access
end
def pause_reminders

@ -32,6 +32,9 @@ describe "Reminder email sending", type: :feature, js: true do
daily_reminders: {
enabled: true,
times: [hitting_reminder_slot_for('Pacific/Honolulu', current_utc_time)]
},
immediate_reminders: {
mentioned: false
}
},
notification_settings: [

@ -9,11 +9,11 @@ describe "Immediate reminder settings", type: :feature, js: true do
# Configure the reminders
reminders_settings_page.visit!
# By default the immediate reminder is unchecked
expect(pref.immediate_reminders[:mentioned]).to be false
reminders_settings_page.expect_immediate_reminder :mentioned, false
# By default the immediate reminder is checked
expect(pref.immediate_reminders[:mentioned]).to be true
reminders_settings_page.expect_immediate_reminder :mentioned, true
reminders_settings_page.set_immediate_reminder :mentioned, true
reminders_settings_page.set_immediate_reminder :mentioned, false
reminders_settings_page.save
@ -21,9 +21,9 @@ describe "Immediate reminder settings", type: :feature, js: true do
reminders_settings_page.reload!
reminders_settings_page.expect_immediate_reminder :mentioned, true
reminders_settings_page.expect_immediate_reminder :mentioned, false
expect(pref.reload.immediate_reminders[:mentioned]).to be true
expect(pref.reload.immediate_reminders[:mentioned]).to be false
end
end

Loading…
Cancel
Save