Commit 83206c1bc214830e5cb35e9d3caf8defb5c3f7b5
1 parent
5b5d62d8
Exists in
master
and in
29 other branches
A few assertions on SearchControllerTest to check facets
Showing
1 changed file
with
6 additions
and
0 deletions
Show diff stats
test/functional/search_controller_test.rb
... | ... | @@ -72,6 +72,7 @@ class SearchControllerTest < ActionController::TestCase |
72 | 72 | |
73 | 73 | get 'articles', :query => 'article found' |
74 | 74 | assert_includes assigns(:results)[:articles], art |
75 | + assert !assigns(:results)[:articles].facets.nil? | |
75 | 76 | end |
76 | 77 | |
77 | 78 | should 'redirect contents to articles' do |
... | ... | @@ -100,6 +101,7 @@ class SearchControllerTest < ActionController::TestCase |
100 | 101 | ent = create_profile_with_optional_category(Enterprise, 'teste') |
101 | 102 | get :enterprises, :query => 'teste' |
102 | 103 | assert_includes assigns(:results)[:enterprises], ent |
104 | + assert !assigns(:results)[:enterprises].facets.nil? | |
103 | 105 | end |
104 | 106 | |
105 | 107 | should 'list enterprises in general' do |
... | ... | @@ -115,6 +117,7 @@ class SearchControllerTest < ActionController::TestCase |
115 | 117 | p1 = create_user('people_1').person; p1.name = 'a beautiful person'; p1.save! |
116 | 118 | get :people, :query => 'beautiful' |
117 | 119 | assert_includes assigns(:results)[:people], p1 |
120 | + assert !assigns(:results)[:people].facets.nil? | |
118 | 121 | end |
119 | 122 | |
120 | 123 | # 'assets' menu outside any category |
... | ... | @@ -133,6 +136,7 @@ class SearchControllerTest < ActionController::TestCase |
133 | 136 | c1 = create_profile_with_optional_category(Community, 'a beautiful community') |
134 | 137 | get :communities, :query => 'beautiful' |
135 | 138 | assert_includes assigns(:results)[:communities], c1 |
139 | + assert !assigns(:results)[:communities].facets.nil? | |
136 | 140 | end |
137 | 141 | |
138 | 142 | # 'assets' menu outside any category |
... | ... | @@ -149,6 +153,7 @@ class SearchControllerTest < ActionController::TestCase |
149 | 153 | prod = ent.products.create!(:name => 'a beautiful product', :product_category => @product_category) |
150 | 154 | get :products, :query => 'beautiful' |
151 | 155 | assert_includes assigns(:results)[:products], prod |
156 | + assert !assigns(:results)[:products].facets.nil? | |
152 | 157 | end |
153 | 158 | |
154 | 159 | # 'assets' menu outside any category |
... | ... | @@ -332,6 +337,7 @@ class SearchControllerTest < ActionController::TestCase |
332 | 337 | get :events, :query => 'event found' |
333 | 338 | |
334 | 339 | assert_includes assigns(:results)[:events], ev |
340 | + assert !assigns(:results)[:events].facets.nil? | |
335 | 341 | end |
336 | 342 | |
337 | 343 | should 'list events for a given month' do | ... | ... |