aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/request_controller_spec.rb
diff options
context:
space:
mode:
authorRobin Houston <robin.houston@gmail.com>2012-01-17 21:44:41 +0000
committerRobin Houston <robin.houston@gmail.com>2012-01-17 21:44:41 +0000
commit2c97a42455edb338a4ffeb529c9dd08bdf2864e0 (patch)
tree0735d4a36215df79a4c8ec854df3793b5f9cb310 /spec/controllers/request_controller_spec.rb
parente60d21cb129d1de487ebedd6b5e9efb22913130d (diff)
parente190eebf7c4bd6a742706e60f2bf941f70d1a1e4 (diff)
Merge branch 'release/0.5' into develop
Conflicts: lib/alaveteli_external_command.rb
Diffstat (limited to 'spec/controllers/request_controller_spec.rb')
-rw-r--r--spec/controllers/request_controller_spec.rb20
1 files changed, 15 insertions, 5 deletions
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb
index 40cb168f4..86665a793 100644
--- a/spec/controllers/request_controller_spec.rb
+++ b/spec/controllers/request_controller_spec.rb
@@ -12,12 +12,12 @@ describe RequestController, "when listing recent requests" do
end
it "should be successful" do
- get :list, :view => 'recent'
+ get :list, :view => 'all'
response.should be_success
end
it "should render with 'list' template" do
- get :list, :view => 'recent'
+ get :list, :view => 'all'
response.should render_template('list')
end
@@ -58,7 +58,7 @@ describe RequestController, "when listing recent requests" do
InfoRequest.should_receive(:full_search).
with([InfoRequestEvent]," (variety:sent OR variety:followup_sent OR variety:response OR variety:comment)", "created_at", anything, anything, anything, anything).
and_return(xap_results)
- get :list, :view => 'recent'
+ get :list, :view => 'all'
assigns[:list_results].size.should == 25
end
end
@@ -450,7 +450,9 @@ describe RequestController, "when searching for an authority" do
"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"]
+ " cardiff",
+ "Foo * bax",
+ "qux ~ quux"]
lambda {
get :select_authority, :query => phrase
}.should_not raise_error(StandardError)
@@ -1518,12 +1520,20 @@ describe RequestController, "when doing type ahead searches" do
assigns[:xapian_requests].should be_nil
end
+ it "should do partial matches for longer words" do
+ get :search_typeahead, :q => "chick"
+ response.should render_template('request/_search_ahead.rhtml')
+ assigns[:xapian_requests].results.size.should ==1
+ 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",
- "uda ( units of dent"]
+ "uda ( units of dent",
+ "frob * baz",
+ "bar ~ qux"]
lambda {
get :search_typeahead, :q => phrase
}.should_not raise_error(StandardError)