mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-01 15:59:24 +08:00
This adds a new notification's user preference to allow users to control whether they are notified whenever one of their topic is being linked in another post. Internal ref - t/160259
31 lines
807 B
Ruby
31 lines
807 B
Ruby
# frozen_string_literal: true
|
|
|
|
module PageObjects
|
|
module Pages
|
|
class UserPreferencesNotifications < PageObjects::Pages::Base
|
|
def visit(user)
|
|
page.visit("/u/#{user.username}/preferences/notifications")
|
|
self
|
|
end
|
|
|
|
def has_notify_on_linked_posts_enabled?
|
|
has_css?(".pref-notify-on-linked-posts input[type='checkbox']:checked")
|
|
end
|
|
|
|
def has_notify_on_linked_posts_disabled?
|
|
has_css?(".pref-notify-on-linked-posts input[type='checkbox']:not(:checked)")
|
|
end
|
|
|
|
def toggle_notify_on_linked_posts
|
|
find(".pref-notify-on-linked-posts input[type='checkbox']").click
|
|
self
|
|
end
|
|
|
|
def save_changes
|
|
click_button "Save Changes"
|
|
expect(page).to have_css(".saved")
|
|
self
|
|
end
|
|
end
|
|
end
|
|
end
|