Sha256: c61db18ad1fc6cd0505a317eac1880d8c630ba871ea349139a1d6de36de7395a

Contents?: true

Size: 1.04 KB

Versions: 2

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.root_path)
      assert(page.has_content?('Success'))
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
workarea-nvy_theme-1.2.1 test/system/workarea/admin/guest_browsing_system_test.decorator
workarea-nvy_theme-1.2.0 test/system/workarea/admin/guest_browsing_system_test.decorator