Commit 9e89e39ee200972acfa8387615b3c8ef050aacf7
1 parent
dc5507b5
Exists in
master
and in
29 other branches
Change remote user plugin to handle any exception
Showing
2 changed files
with
11 additions
and
3 deletions
Show diff stats
plugins/remote_user/lib/remote_user_plugin.rb
plugins/remote_user/test/functional/remote_user_plugin_test.rb
... | ... | @@ -3,7 +3,7 @@ require File.dirname(__FILE__) + '/../../../../test/test_helper' |
3 | 3 | # Re-raise errors caught by the controller. |
4 | 4 | class AccountController; def rescue_action(e) raise e end; end |
5 | 5 | |
6 | -class AccountControllerTest < ActionController::TestCase | |
6 | +class AccountControllerTest < ActionController::TestCase | |
7 | 7 | def setup |
8 | 8 | @environment = Environment.default |
9 | 9 | @environment.enabled_plugins = ['RemoteUserPlugin'] |
... | ... | @@ -125,10 +125,18 @@ class AccountControllerTest < ActionController::TestCase |
125 | 125 | get :index |
126 | 126 | |
127 | 127 | assert session[:user].blank? |
128 | - | |
128 | + | |
129 | 129 | @request.env["HTTP_REMOTE_USER"] = "" |
130 | 130 | get :index |
131 | 131 | |
132 | 132 | assert session[:user].blank? |
133 | 133 | end |
134 | + | |
135 | + should 'not create a new user if his informations is invalid' do | |
136 | + @request.env["HTTP_REMOTE_USER"] = "*%&invalid user name&%*" | |
137 | + get :index | |
138 | + | |
139 | + assert session[:user].blank? | |
140 | + assert_response 404 | |
141 | + end | |
134 | 142 | end | ... | ... |