Sha256: 9ab5511f77df9f5069258e3dcb49baa63aab05e75e936b52c1b87f45b4aa4a31

Contents?: true

Size: 970 Bytes

Versions: 28

Compression:

Stored size: 970 Bytes

Contents

require 'test_helper'

module Workarea
  module Admin
    class GuestBrowsingsIntegrationTest < Workarea::IntegrationTest
      include Admin::IntegrationTest
      setup :set_admin_user

      def set_admin_user
        admin_user.update!(password: 'W3bl1nc!')

        post storefront.login_path,
          params: { email: admin_user.email, password: 'W3bl1nc!' }
      end

      def test_start_guest_browsing
        previous_user_id = session[:user_id]

        post admin.guest_browsing_path

        assert(response.redirect?)
        assert_nil(session[:user_id])
        assert_equal(previous_user_id, session[:admin_id])
      end

      def test_ending_guest_browsing
        previous_user_id = session[:user_id]

        post admin.guest_browsing_path
        delete admin.guest_browsing_path

        assert(response.redirect?)
        assert_equal(previous_user_id, session[:user_id])
        assert(session[:admin_id].blank?)
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
workarea-admin-3.5.27 test/integration/workarea/admin/guest_browsings_integration_test.rb
workarea-admin-3.5.26 test/integration/workarea/admin/guest_browsings_integration_test.rb
workarea-admin-3.5.25 test/integration/workarea/admin/guest_browsings_integration_test.rb
workarea-admin-3.5.23 test/integration/workarea/admin/guest_browsings_integration_test.rb
workarea-admin-3.5.22 test/integration/workarea/admin/guest_browsings_integration_test.rb
workarea-admin-3.5.21 test/integration/workarea/admin/guest_browsings_integration_test.rb
workarea-admin-3.5.20 test/integration/workarea/admin/guest_browsings_integration_test.rb
workarea-admin-3.5.19 test/integration/workarea/admin/guest_browsings_integration_test.rb
workarea-admin-3.5.18 test/integration/workarea/admin/guest_browsings_integration_test.rb
workarea-admin-3.5.17 test/integration/workarea/admin/guest_browsings_integration_test.rb
workarea-admin-3.5.16 test/integration/workarea/admin/guest_browsings_integration_test.rb
workarea-admin-3.5.15 test/integration/workarea/admin/guest_browsings_integration_test.rb
workarea-admin-3.5.14 test/integration/workarea/admin/guest_browsings_integration_test.rb
workarea-admin-3.5.13 test/integration/workarea/admin/guest_browsings_integration_test.rb
workarea-admin-3.5.12 test/integration/workarea/admin/guest_browsings_integration_test.rb
workarea-admin-3.5.11 test/integration/workarea/admin/guest_browsings_integration_test.rb
workarea-admin-3.5.10 test/integration/workarea/admin/guest_browsings_integration_test.rb
workarea-admin-3.5.9 test/integration/workarea/admin/guest_browsings_integration_test.rb
workarea-admin-3.5.8 test/integration/workarea/admin/guest_browsings_integration_test.rb
workarea-admin-3.5.7 test/integration/workarea/admin/guest_browsings_integration_test.rb