|
27 | 27 | it "has docs and facets for query with results", :integration do
|
28 | 28 | get :index, params: { q: user_query }
|
29 | 29 | expect(assigns(:response).docs).not_to be_empty
|
| 30 | + |
30 | 31 | assert_facets_have_values(assigns(:response).aggregations)
|
31 | 32 | end
|
32 | 33 |
|
33 | 34 | it "has docs and facets for existing facet value", :integration do
|
34 | 35 | get :index, params: { f: { "format" => 'Book' } }
|
35 | 36 | expect(assigns(:response).docs).not_to be_empty
|
| 37 | + |
36 | 38 | assert_facets_have_values(assigns(:response).aggregations)
|
37 | 39 | end
|
38 | 40 |
|
39 | 41 | it "has docs and facets for non-default results per page", :integration do
|
40 | 42 | num_per_page = 7
|
41 | 43 | get :index, params: { per_page: num_per_page }
|
42 | 44 | expect(assigns(:response).docs).to have(num_per_page).items
|
| 45 | + |
43 | 46 | assert_facets_have_values(assigns(:response).aggregations)
|
44 | 47 | end
|
45 | 48 |
|
|
48 | 51 | get :index, params: { page: page }
|
49 | 52 | expect(assigns(:response).docs).not_to be_empty
|
50 | 53 | expect(assigns(:response).params[:start].to_i).to eq (page - 1) * controller.blacklight_config[:default_solr_params][:rows]
|
| 54 | + |
51 | 55 | assert_facets_have_values(assigns(:response).aggregations)
|
52 | 56 | end
|
53 | 57 |
|
|
74 | 78 | expect(assigns(:response).docs).to be_empty
|
75 | 79 | end
|
76 | 80 |
|
77 |
| - it "has a spelling suggestion for an appropriately poor query", :integration do |
| 81 | + it "has a spelling suggestion for an appropriately poor query", :integration, :solr do |
78 | 82 | get :index, params: { q: 'boo' }
|
79 | 83 | expect(assigns(:response).spelling.words).not_to be_nil
|
80 | 84 | end
|
|
102 | 106 |
|
103 | 107 | it "gets facets when no query", :integration do
|
104 | 108 | get :index
|
| 109 | + |
105 | 110 | assert_facets_have_values(assigns(:response).aggregations)
|
106 | 111 | end
|
107 | 112 | end
|
|
246 | 251 |
|
247 | 252 | it "redirects to show action for doc id" do
|
248 | 253 | put :track, params: { id: doc_id, counter: 3 }
|
| 254 | + |
249 | 255 | assert_redirected_to(solr_document_path(doc_id))
|
250 | 256 | end
|
251 | 257 |
|
|
256 | 262 |
|
257 | 263 | it "redirects to the path given in the redirect param" do
|
258 | 264 | put :track, params: { id: doc_id, counter: 3, redirect: '/xyz' }
|
| 265 | + |
259 | 266 | assert_redirected_to("/xyz")
|
260 | 267 | end
|
261 | 268 |
|
262 | 269 | it "redirects to the path of the uri given in the redirect param" do
|
263 | 270 | put :track, params: { id: doc_id, counter: 3, redirect: 'http://localhost:3000/xyz' }
|
| 271 | + |
264 | 272 | assert_redirected_to("/xyz")
|
265 | 273 | end
|
266 | 274 |
|
267 | 275 | it "keeps querystring on redirect" do
|
268 | 276 | put :track, params: { id: doc_id, counter: 3, redirect: 'http://localhost:3000/xyz?locale=pt-BR' }
|
| 277 | + |
269 | 278 | assert_redirected_to("/xyz?locale=pt-BR")
|
270 | 279 | end
|
271 | 280 | end
|
|
0 commit comments