Module: Workarea::Storefront::ProductBrowsingViewModelTest
- Extended by:
- ActiveSupport::Concern
- Includes:
- PaginationViewModelTest
- Defined in:
- lib/workarea/storefront/product_browsing_view_model_test.rb
Instance Method Summary
collapse
#pagination_view_model, #test_first_page, #test_last_page, #test_next_page, #test_prev_page, #test_total_pages
Instance Method Details
7
8
9
|
# File 'lib/workarea/storefront/product_browsing_view_model_test.rb', line 7
def
product_browsing_view_model_class
end
|
#test_facets ⇒ Object
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/workarea/storefront/product_browsing_view_model_test.rb', line 23
def test_facets
view_model = product_browsing_view_model_class.new(stub_everything)
facets = [mock, mock]
search = Search::ProductSearch.new
search.expects(:facets).returns(facets).at_least_once
view_model.expects(:search_query).returns(search).twice
facets.first.stubs(:useless?).returns(true)
facets.second.stubs(:useless?).returns(false)
assert_equal(1, view_model.facets.size)
refute(view_model.facets.first.useless?)
end
|
#test_has_filters ⇒ Object
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/workarea/storefront/product_browsing_view_model_test.rb', line 11
def test_has_filters
view_model = product_browsing_view_model_class.new(stub_everything)
facet = mock
view_model.expects(:facets).returns([facet]).twice
facet.expects(:selected?).returns(true)
assert(view_model.has_filters?)
facet.expects(:selected?).returns(false)
refute(view_model.has_filters?)
end
|