aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/request_controller_spec.rb
diff options
context:
space:
mode:
authorRobin Houston <robin.houston@gmail.com>2012-01-12 17:56:56 +0000
committerRobin Houston <robin.houston@gmail.com>2012-01-12 17:56:56 +0000
commit5e400fd939091a12515b069d618b9e7b18bb4016 (patch)
tree6d123ac3565bc5351a7c8fc94819e03460e7e0b9 /spec/controllers/request_controller_spec.rb
parentcb020f57f9cec5610c40bbcb85257776c27642a1 (diff)
parent0aafbd4a25b5c4c0edbd87c2224dcdd18388ede5 (diff)
Merge branch 'release/0.5' of https://github.com/sebbacon/alaveteli into release/0.5
Conflicts: app/controllers/request_controller.rb
Diffstat (limited to 'spec/controllers/request_controller_spec.rb')
-rw-r--r--spec/controllers/request_controller_spec.rb17
1 files changed, 15 insertions, 2 deletions
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb
index fc62edc14..96786a0a3 100644
--- a/spec/controllers/request_controller_spec.rb
+++ b/spec/controllers/request_controller_spec.rb
@@ -420,7 +420,7 @@ describe RequestController, "when searching for an authority" do
get :select_authority, :query => ""
response.should render_template('select_authority')
- assigns[:xapian_requests].results.size == 0
+ assigns[:xapian_requests].should == nil
end
it "should return matching bodies" do
@@ -431,6 +431,18 @@ describe RequestController, "when searching for an authority" do
assigns[:xapian_requests].results.size == 1
assigns[:xapian_requests].results[0][:model].name.should == public_bodies(:geraldine_public_body).name
end
+
+ it "should not give an error when user users unintended search operators" do
+ for phrase in ["Marketing/PR activities - Aldborough E-Act Free Schoo",
+ "Request for communications between DCMS/Ed Vaizey and ICO from Jan 1st 2011 - May ",
+ "Bellevue Road Ryde Isle of Wight PO33 2AR - what is the",
+ "NHS Ayrshire & Arran",
+ " cardiff"]
+ lambda {
+ get :select_authority, :query => phrase
+ }.should_not raise_error(StandardError)
+ end
+ end
end
describe RequestController, "when creating a new request" do
@@ -1496,7 +1508,8 @@ describe RequestController, "when doing type ahead searches" do
it "should not give an error when user users unintended search operators" do
for phrase in ["Marketing/PR activities - Aldborough E-Act Free Schoo",
"Request for communications between DCMS/Ed Vaizey and ICO from Jan 1st 2011 - May ",
- "Bellevue Road Ryde Isle of Wight PO33 2AR - what is the"]
+ "Bellevue Road Ryde Isle of Wight PO33 2AR - what is the",
+ "NHS Ayrshire & Arran"]
lambda {
get :search_typeahead, :q => phrase
}.should_not raise_error(StandardError)