Sha256: 257fd0e60fd40ae47b84c6e9efbf707ee0fc30641c31600db7f216ed27f69195
Contents?: true
Size: 755 Bytes
Versions: 26
Compression:
Stored size: 755 Bytes
Contents
module FeatureHelpers def in_browser(name) original_browser = Capybara.session_name Capybara.session_name = name yield Capybara.session_name = original_browser end def sign_in(options = {}) visit login_path fill_in 'username', with: options[:username] || 'testuser' fill_in 'password', with: options[:password] || 'foobar123' click_button 'Login' end def enable_two_factor_authentication visit new_two_factor_authenticator_path secret = find('p#secret').text.gsub(/^Secret:\s*/, '') ROTP::TOTP.new(secret).tap do |totp| fill_in 'otp', with: "#{totp.now}" click_button 'Verify and enable' end end end RSpec.configure do |config| config.include FeatureHelpers, type: :feature end
Version data entries
26 entries across 26 versions & 1 rubygems