diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2012-01-17 12:50:30 +0000 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2012-01-17 12:53:52 +0000 |
commit | c8a68219c541840b5c5f56cd75c1e84de6c15fe5 (patch) | |
tree | 9b1f062ba77a19b63c09a90710004959465c470b /spec/controllers/request_controller_spec.rb | |
parent | 3b0222d887e2ef1bd508e505b2327f8c2acac1d3 (diff) |
Actually do a proper ORed and partial match query, rather than fix parsing errors ad hoc as I find them that result from the workaround code. Fixes #328 (for good, I hope).
Diffstat (limited to 'spec/controllers/request_controller_spec.rb')
-rw-r--r-- | spec/controllers/request_controller_spec.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb index 40cb168f4..dcdacc29c 100644 --- a/spec/controllers/request_controller_spec.rb +++ b/spec/controllers/request_controller_spec.rb @@ -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) |