Sha256: 1a21c2563d42535e4cf9d3528c20d8eee4f13b8fad8b4d03e2e6c0175b6742dd
Contents?: true
Size: 1.72 KB
Versions: 5
Compression:
Stored size: 1.72 KB
Contents
require 'test_helper' module Workarea decorate Storefront::PasswordsSystemTest, with: :nvy_theme do def test_admin_forcing_password_resets Workarea.with_config do |config| config.password_lifetime = 1.second sleep(1) # sign in for the first time visit storefront.login_path within '#login_form' do fill_in 'email', with: @admin_email fill_in 'password', with: 'W3bl1nc!' click_button t('workarea.storefront.users.login') end assert_current_path(storefront.change_password_path) # sign out reset_session! visit storefront.login_path # sign in again within '#login_form' do fill_in 'email', with: @admin_email fill_in 'password', with: 'W3bl1nc!' click_button t('workarea.storefront.users.login') end assert_current_path(storefront.change_password_path) # disallow all other page movement visit storefront.root_path assert_current_path(storefront.change_password_path) config.password_lifetime = 1.hour fill_in 'old_password', with: 'W3bl1nc!' fill_in 'password', with: @password click_button t('workarea.storefront.users.change_password') assert_current_path(storefront.users_account_path) page.find('.page-header__account-link').click click_link t('workarea.storefront.users.logout') visit storefront.login_path within '#login_form' do fill_in 'email', with: @admin_email fill_in 'password', with: @password click_button t('workarea.storefront.users.login') end assert_current_path(admin.root_path) end end end end
Version data entries
5 entries across 5 versions & 1 rubygems