Files
nairobi/spec/system/subscriptions_spec.rb
taitus 2bfdc421ae Allow updating the status of notifications
You can update the same "notifications" section that we allow you to
update in "my account".

This "subscriptions" section differs from the "my account" section
because we do not need to be logged in to update the status of the
notifications.
2022-01-21 20:21:38 +01:00

31 lines
1.4 KiB
Ruby

require "rails_helper"
describe "Subscriptions" do
let(:user) { create(:user, subscriptions_token: SecureRandom.base58(32)) }
context "Update" do
scenario "Allow updating the status notification" do
user.update!(email_on_comment: false,
email_on_comment_reply: true,
newsletter: true,
email_digest: false,
email_on_direct_message: true)
visit edit_subscriptions_path(token: user.subscriptions_token)
check "Notify me by email when someone comments on my proposals or debates"
uncheck "Notify me by email when someone replies to my comments"
uncheck "Receive by email website relevant information"
check "Receive a summary of proposal notifications"
uncheck "Receive emails about direct messages"
click_button "Save changes"
expect(page).to have_content "Changes saved"
expect(page).to have_field "Notify me by email when someone comments on my contents", checked: true
expect(page).to have_field "Notify me by email when someone replies to my comments", checked: false
expect(page).to have_field "Receive by email website relevant information", checked: false
expect(page).to have_field "Receive a summary of proposal notifications", checked: true
expect(page).to have_field "Receive emails about direct messages", checked: false
end
end
end