Sha256: cd72053f7aafda1076dbb3548c318d6674b1a5827a8c9f776d5a493778805358

Contents?: true

Size: 1.04 KB

Versions: 3

Compression:

Stored size: 1.04 KB

Contents

module Workarea
  decorate Admin::GuestBrowsingSystemTest, with: :haven_theme do
    def test_browsing_as_a_guest
      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.users_path
      click_link t('workarea.admin.users.index.browse_as_guest')

      assert_current_path(storefront.root_path)
      assert(page.has_content?('Success'))

      page.find('.page-header__account-link').click
      click_link t('workarea.storefront.users.account')
      assert_current_path(storefront.login_path)

      find('.message__dismiss-button').click

      within_frame find('.admin-toolbar') do
        click_button t('workarea.admin.toolbar.stop_guest_browsing')
      end

      assert_current_path(admin.users_path)
      assert(page.has_content?('Success'))
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
workarea-nvy_theme-1.1.4 test/system/workarea/admin/guest_browsing_system_test.decorator
workarea-nvy_theme-1.1.3 test/system/workarea/admin/guest_browsing_system_test.decorator
workarea-nvy_theme-1.1.2 test/system/workarea/admin/guest_browsing_system_test.decorator