Sha256: 1e36044af1887c40c9dc6a331f672097aff8c285ad61170f0ab678572f09d3ad

Contents?: true

Size: 665 Bytes

Versions: 34

Compression:

Stored size: 665 Bytes

Contents

require 'test_helper'

module Workarea
  module Search
    class StorefrontTest < TestCase
      def test_active
        model = create_product(active: false)
        refute(Storefront.new(model).active[:now])

        model.update_attributes!(active: true)
        assert(Storefront.new(model).active[:now])

        model.update_attributes!(active: false)
        release = create_release

        Release.with_current(release.id) do
          model.update_attributes!(active: true)
        end

        model.reload
        results = Storefront.new(model).active
        refute(results[:now])
        assert(results[release.id.to_s])
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
workarea-core-3.4.25 test/models/workarea/search/storefront_test.rb
workarea-core-3.4.24 test/models/workarea/search/storefront_test.rb
workarea-core-3.4.23 test/models/workarea/search/storefront_test.rb
workarea-core-3.4.22 test/models/workarea/search/storefront_test.rb
workarea-core-3.4.21 test/models/workarea/search/storefront_test.rb
workarea-core-3.4.20 test/models/workarea/search/storefront_test.rb
workarea-core-3.4.19 test/models/workarea/search/storefront_test.rb
workarea-core-3.4.18 test/models/workarea/search/storefront_test.rb
workarea-core-3.4.17 test/models/workarea/search/storefront_test.rb
workarea-core-3.4.16 test/models/workarea/search/storefront_test.rb
workarea-core-3.4.15 test/models/workarea/search/storefront_test.rb
workarea-core-3.4.14 test/models/workarea/search/storefront_test.rb
workarea-core-3.4.13 test/models/workarea/search/storefront_test.rb
workarea-core-3.4.12 test/models/workarea/search/storefront_test.rb