mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-04 23:30:21 +08:00
24 lines
637 B
Ruby
24 lines
637 B
Ruby
# frozen_string_literal: true
|
|
|
|
module PageObjects
|
|
module Pages
|
|
class UserPreferencesSecurity < PageObjects::Pages::Base
|
|
def visit(user)
|
|
page.visit("/u/#{user.username}/preferences/security")
|
|
self
|
|
end
|
|
|
|
def click_manage_2fa_authentication
|
|
click_button "Manage Two-Factor Authentication"
|
|
PageObjects::Modals::ConfirmSession.new
|
|
end
|
|
|
|
def visit_second_factor(user, password)
|
|
click_manage_2fa_authentication.submit_password(password)
|
|
|
|
expect(page).to have_current_path("/u/#{user.username}/preferences/second-factor")
|
|
self
|
|
end
|
|
end
|
|
end
|
|
end
|