Sha256: 897ce3038ea3ed59f8c1b70b78777981a76e16ba1438ecd4d0f566bb605794d5
Contents?: true
Size: 968 Bytes
Versions: 34
Compression:
Stored size: 968 Bytes
Contents
require 'test_helper' module Workarea module Storefront class AnalyticsIntegrationTest < Workarea::IntegrationTest def test_saving_product_view post storefront.analytics_product_view_path(product_id: 'foo') assert_equal(1, Metrics::ProductByDay.first.views) end def test_saving_search post storefront.analytics_search_path(q: 'foo', total_results: '5') insights = Metrics::SearchByDay.first assert_equal(1, insights.searches) assert_equal(5, insights.total_results) end def test_saving_category_view post storefront.analytics_category_view_path(category_id: 'foo') assert_equal(1, Metrics::CategoryByDay.first.views) end def test_blocking_bots post storefront.analytics_product_view_path(product_id: 'foo'), headers: { 'HTTP_USER_AGENT' => 'Googlebot' } assert(Metrics::ProductByDay.count.zero?) end end end end
Version data entries
34 entries across 34 versions & 1 rubygems