Sha256: efe65e47a326919cfd1375c5747bf284567043f7f134bb0c738e1ccf73d65364

Contents?: true

Size: 1.08 KB

Versions: 35

Compression:

Stored size: 1.08 KB

Contents

require 'test_helper'

module Workarea
  module Search
    class Admin
      class ReleasableTest < TestCase
        class Foo < Admin
          include Releasable
        end

        def test_facets
          releasable = create_page(name: 'Foo')

          release_one = create_release
          release_two = create_release
          release_three = create_release

          release_one.as_current { releasable.update_attributes!(name: 'Bar') }

          release_two.as_current do
            content = Workarea::Content.for(releasable)
            content.update_attributes!(browser_title: 'Foo')
          end

          release_three.as_current { releasable.update_attributes!(name: 'Bar') }
          release_three.update_attributes!(published_at: Time.current)

          search_model = Foo.new(releasable)
          assert_includes(search_model.facets[:upcoming_changes], release_one.id)
          assert_includes(search_model.facets[:upcoming_changes], release_two.id)
          refute_includes(search_model.facets[:upcoming_changes], release_three.id)
        end
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
workarea-core-3.4.45 test/models/workarea/search/admin/releasable_test.rb
workarea-core-3.4.44 test/models/workarea/search/admin/releasable_test.rb
workarea-core-3.4.43 test/models/workarea/search/admin/releasable_test.rb
workarea-core-3.4.42 test/models/workarea/search/admin/releasable_test.rb
workarea-core-3.4.41 test/models/workarea/search/admin/releasable_test.rb
workarea-core-3.4.40 test/models/workarea/search/admin/releasable_test.rb
workarea-core-3.4.39 test/models/workarea/search/admin/releasable_test.rb
workarea-core-3.4.38 test/models/workarea/search/admin/releasable_test.rb
workarea-core-3.4.37 test/models/workarea/search/admin/releasable_test.rb
workarea-core-3.4.36 test/models/workarea/search/admin/releasable_test.rb
workarea-core-3.4.35 test/models/workarea/search/admin/releasable_test.rb
workarea-core-3.4.34 test/models/workarea/search/admin/releasable_test.rb
workarea-core-3.4.33 test/models/workarea/search/admin/releasable_test.rb
workarea-core-3.4.32 test/models/workarea/search/admin/releasable_test.rb
workarea-core-3.4.31 test/models/workarea/search/admin/releasable_test.rb
workarea-core-3.4.30 test/models/workarea/search/admin/releasable_test.rb
workarea-core-3.4.29 test/models/workarea/search/admin/releasable_test.rb
workarea-core-3.4.28 test/models/workarea/search/admin/releasable_test.rb
workarea-core-3.4.27 test/models/workarea/search/admin/releasable_test.rb
workarea-core-3.4.26 test/models/workarea/search/admin/releasable_test.rb