diff options
author | Louise Crow <louise.crow@gmail.com> | 2015-03-30 16:00:02 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2015-03-30 16:00:02 +0100 |
commit | f24cc98afa25ad6010ae5316eecc15dfdb3fa79b (patch) | |
tree | c32fecb16bb2097da7dfdf90e6915fce0bf1a425 /spec/controllers/public_body_controller_spec.rb | |
parent | 823e58dc69960c600230b10604a0051359173f85 (diff) | |
parent | 3c0604cf900ad274d8f6ff421d39854ccbf4b6af (diff) |
Merge branch 'release/0.21'0.21.0.0
Conflicts:
locale/cy/app.po
locale/es_NI/app.po
locale/hr/app.po
locale/is_IS/app.po
locale/sr@latin/app.po
Diffstat (limited to 'spec/controllers/public_body_controller_spec.rb')
-rw-r--r-- | spec/controllers/public_body_controller_spec.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/controllers/public_body_controller_spec.rb b/spec/controllers/public_body_controller_spec.rb index 840b4bb28..130631ef6 100644 --- a/spec/controllers/public_body_controller_spec.rb +++ b/spec/controllers/public_body_controller_spec.rb @@ -70,6 +70,18 @@ describe PublicBodyController, "when showing a body" do get :show, :url_name => "dFh", :view => 'all' response.should redirect_to(:controller => 'public_body', :action => 'show', :url_name => "dfh") end + + it 'keeps the search_params flash' do + # Make two get requests to simulate the flash getting swept after the + # first response. + search_params = { 'query' => 'Quango' } + get :show, { :url_name => 'dfh', :view => 'all' }, + nil, + { :search_params => search_params } + get :show, :url_name => 'dfh', :view => 'all' + expect(flash[:search_params]).to eq(search_params) + end + end describe PublicBodyController, "when listing bodies" do @@ -479,4 +491,15 @@ describe PublicBodyController, "when doing type ahead searches" do response.should render_template('public_body/_search_ahead') assigns[:xapian_requests].should be_nil end + + it 'remembers the search params' do + search_params = { + 'query' => 'Quango', + 'page' => '1', + 'bodies' => '1' + } + get :search_typeahead, search_params + expect(flash[:search_params]).to eq(search_params) + end + end |