diff options
author | Robin Houston <robin.houston@gmail.com> | 2012-01-29 16:35:06 +0000 |
---|---|---|
committer | Robin Houston <robin.houston@gmail.com> | 2012-01-29 16:35:06 +0000 |
commit | 9613b118b148dff0d54100d7f931189b59f3535c (patch) | |
tree | ed9334c8905aac38f96de6eca1ade8fcfa6f1a54 /spec/integration | |
parent | 5aa2bd13042110e73212f83564c35b3a1d672bbb (diff) |
More test data, and fix tests
Add some more test data, and fix the tests to accommodate both this
new test data and the fact that raw emails are now correctly loaded
into the test environment.
Diffstat (limited to 'spec/integration')
-rw-r--r-- | spec/integration/search_request_spec.rb | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/spec/integration/search_request_spec.rb b/spec/integration/search_request_spec.rb index 317a3cab7..61f8df313 100644 --- a/spec/integration/search_request_spec.rb +++ b/spec/integration/search_request_spec.rb @@ -34,21 +34,34 @@ describe "When searching" do end it "should correctly filter searches for requests" do - request_via_redirect("post", "/search/bob/requests") + request_via_redirect("post", "/search/bob/requests") response.body.should_not include("One person found") - response.body.should include("FOI requests 1 to 2 of 2") + n = 4 # The number of requests that contain the word "bob" somewhere + # in the email text. At present this is: + # - fancy_dog_request + # - naughty_chicken_request + # - boring_request + # - another_boring_request + # + # In other words it is all requests made by Bob Smith + # except for badger_request, which he did not sign. + response.body.should include("FOI requests 1 to #{n} of #{n}") end it "should correctly filter searches for users" do - request_via_redirect("post", "/search/bob/users") + request_via_redirect("post", "/search/bob/users") response.body.should include("One person found") - response.body.should_not include("FOI requests 1 to 2 of 2") + response.body.should_not include("FOI requests 1 to") end it "should correctly filter searches for successful requests" do request_via_redirect("post", "/search/requests", :query => "bob", :latest_status => ['successful']) - response.body.should include("no results matching your query") + n = 2 # The number of *successful* requests that contain the word "bob" somewhere + # in the email text. At present this is: + # - boring_request + # - another_boring_request + response.body.should include("FOI requests 1 to #{n} of #{n}") end it "should correctly filter searches for comments" do |