Sha256: c66fb0facc8ce4b88f153d4b035e7b4e036a9a64f197db440bf9dce5ffab0f35

Contents?: true

Size: 925 Bytes

Versions: 3

Compression:

Stored size: 925 Bytes

Contents

require 'test_helper'

module Workarea
  module Storefront
    class ProductQuickviewHelperTest < ViewTest
      include Workarea::Storefront::Engine.routes.url_helpers
      include AnalyticsHelper
      include Workarea::TestCase::SearchIndexing

      def test_quickview_button_data
        model = create_product
        view_model = ProductViewModel.wrap(model)

        result = quickview_button_data(view_model)

        assert_includes(result, :url)
        assert_includes(result, :analytics_data)
        assert_includes(result.to_s, view_model.id)
      end

      def test_product_quickview_analytics_data
        model = create_product
        view_model = ProductViewModel.wrap(model)

        result = product_quickview_analytics_data(view_model)

        assert_includes(result, :event)
        assert_includes(result, :payload)
        assert_includes(result.to_s, view_model.id)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
workarea-product_quickview-2.0.4 test/helpers/workarea/storefront/product_quickview_helper_test.rb
workarea-product_quickview-2.0.3 test/helpers/workarea/storefront/product_quickview_helper_test.rb
workarea-product_quickview-2.0.2 test/helpers/workarea/storefront/product_quickview_helper_test.rb