diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2011-08-03 14:18:22 +0100 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2011-08-03 14:18:22 +0100 |
commit | cd73e401622d31a189d8cf3b38e9cbe46ca73e96 (patch) | |
tree | e5efd1f1a4c650ec4333a59d54d015342e24ddbf /spec/controllers | |
parent | f5e5b605bac9e80f7556b666643eec25b6987545 (diff) |
Fail silently if there's no user matching one referenced in the current session. Fixes #105
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/general_controller_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/controllers/general_controller_spec.rb b/spec/controllers/general_controller_spec.rb index 7807a5541..619635eea 100644 --- a/spec/controllers/general_controller_spec.rb +++ b/spec/controllers/general_controller_spec.rb @@ -17,6 +17,13 @@ describe GeneralController, "when searching" do response.should be_success end + it "doesn't raise an error when there's no user matching the one in the session" do + session[:user_id] = 999 + get :frontpage + response.should be_success + end + + it "should redirect from search query URL to pretty URL" do post :search_redirect, :query => "mouse" # query hidden in POST parameters response.should redirect_to(:action => 'search', :combined => "mouse") # URL /search/:query |