Sha256: 85efcb1551ee9f02288abda6283592d67015c1526d336c6790faeae3bab0f5d4
Contents?: true
Size: 1.76 KB
Versions: 42
Compression:
Stored size: 1.76 KB
Contents
require 'test_helper' module Workarea module Admin class ImpersonationSystemTest < SystemTest def test_impersonating_a_user user = create_user(email: 'impersonated@workarea.com') create_user( email: 'bcrouse@workarea.com', password: 'W3bl1nc!', super_admin: true ) visit storefront.login_path within '#login_form' do fill_in 'email', with: 'bcrouse@workarea.com' fill_in 'password', with: 'W3bl1nc!' click_button 'login' end visit admin.user_path(user) click_button t('workarea.admin.users.show.impersonate') assert_equal(storefront.users_account_path, current_path) assert(page.has_content?('Success')) assert(page.has_content?('impersonated@workarea.com')) visit storefront.root_path within_frame find('.admin-toolbar') do wait_for_iframe assert(page.has_content?('impersonated@workarea.com')) click_button 'Stop Impersonation' end assert_equal(admin.user_path(user), current_path) assert(page.has_content?('Success')) find('.view').hover # Ensure tooltipster menu isn't open assert(page.has_content?('bcrouse@workarea.com')) visit storefront.users_account_path assert(page.has_no_content?('impersonated@workarea.com')) visit admin.user_path(user) click_button t('workarea.admin.users.show.impersonate') visit admin.root_path within '.header' do assert(page.has_content?('impersonated@workarea.com')) click_button 'Stop Impersonation' end assert_equal(admin.user_path(user), current_path) assert(page.has_content?('Success')) end end end end
Version data entries
42 entries across 42 versions & 1 rubygems