hackatime/test/system/settings/notifications_settings_test.rb
Mahad Kalam 1f695850e5
Bring back Mailkick (#1021)
* Sources say Charlie Kick is stable. Please god

* Some tests + guards + unsub URL fix

* Fix lockfile!

* bin/rubocop -A

* if this does not work I am going to kms

* phew
2026-03-01 14:26:54 +00:00

35 lines
952 B
Ruby

require "application_system_test_case"
require_relative "test_helpers"
class NotificationsSettingsTest < ApplicationSystemTestCase
include SettingsSystemTestHelpers
setup do
@user = User.create!(timezone: "UTC")
sign_in_as(@user)
end
test "notifications settings page renders weekly summary section" do
assert_settings_page(
path: my_settings_notifications_path,
marker_text: "Email Notifications"
)
assert_text "Weekly coding summary email"
end
test "notifications settings updates weekly summary email preference" do
@user.subscribe("weekly_summary") unless @user.subscribed?("weekly_summary")
visit my_settings_notifications_path
within("#user_weekly_summary_email") do
find("[role='checkbox']", wait: 10).click
end
click_on "Save notification settings"
assert_text "Settings updated successfully"
assert_not @user.reload.subscribed?("weekly_summary")
end
end