Sha256: 5bf916beb55b606a18ad12cbc10eb6f240621da68a6ee83f603764a2551d6a76

Contents?: true

Size: 1.11 KB

Versions: 62

Compression:

Stored size: 1.11 KB

Contents

require 'test_helper'

module Workarea
  module Admin
    class VisitingIntegrationTest < Workarea::IntegrationTest
      include Admin::IntegrationTest

      def test_visiting
        product = create_product

        get admin.root_path
        assert_equal(0, User::AdminVisit.count)

        get admin.toolbar_path
        assert_equal(0, User::AdminVisit.count)

        get admin.catalog_products_path, xhr: true
        assert_equal(0, User::AdminVisit.count)

        patch admin.catalog_product_path(product),
          params: { product: { name: 'Test Product' } }
        assert_equal(0, User::AdminVisit.count)

        get admin.catalog_products_path
        assert_equal(1, User::AdminVisit.count)

        visit = User::AdminVisit.first
        assert_equal(admin.catalog_products_path, visit.path)
        assert(visit.name.present?)

        get admin.catalog_product_path(product)
        assert_equal(2, User::AdminVisit.count)

        visit = User::AdminVisit.desc(:created_at).first
        assert_equal(admin.catalog_product_path(product), visit.path)
        assert(visit.name.present?)
      end
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-admin-3.4.27 test/integration/workarea/admin/visiting_integration_test.rb
workarea-admin-3.5.4 test/integration/workarea/admin/visiting_integration_test.rb
workarea-admin-3.4.26 test/integration/workarea/admin/visiting_integration_test.rb
workarea-admin-3.5.3 test/integration/workarea/admin/visiting_integration_test.rb
workarea-admin-3.4.25 test/integration/workarea/admin/visiting_integration_test.rb
workarea-admin-3.5.2 test/integration/workarea/admin/visiting_integration_test.rb
workarea-admin-3.4.24 test/integration/workarea/admin/visiting_integration_test.rb
workarea-admin-3.5.1 test/integration/workarea/admin/visiting_integration_test.rb
workarea-admin-3.4.23 test/integration/workarea/admin/visiting_integration_test.rb
workarea-admin-3.4.22 test/integration/workarea/admin/visiting_integration_test.rb
workarea-admin-3.5.0 test/integration/workarea/admin/visiting_integration_test.rb
workarea-admin-3.4.21 test/integration/workarea/admin/visiting_integration_test.rb
workarea-admin-3.5.0.beta.1 test/integration/workarea/admin/visiting_integration_test.rb
workarea-admin-3.4.20 test/integration/workarea/admin/visiting_integration_test.rb
workarea-admin-3.4.19 test/integration/workarea/admin/visiting_integration_test.rb
workarea-admin-3.4.18 test/integration/workarea/admin/visiting_integration_test.rb
workarea-admin-3.4.17 test/integration/workarea/admin/visiting_integration_test.rb
workarea-admin-3.4.16 test/integration/workarea/admin/visiting_integration_test.rb
workarea-admin-3.4.15 test/integration/workarea/admin/visiting_integration_test.rb
workarea-admin-3.4.14 test/integration/workarea/admin/visiting_integration_test.rb