summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2013-08-27 14:56:41 +0200
committerAzul <azul@leap.se>2013-08-27 14:57:44 +0200
commit1e6e6d82ed53b1db558b7c1f4e14740962cc406a (patch)
tree8b390e380449c9b350cef9c8d6648e4088012ff9
parent5e6a2a2995598489372676bf8e045dc2dfda6c81 (diff)
separate different tests for showing non existant user
This way the failed stubbing errors were more telling
-rw-r--r--users/test/functional/users_controller_test.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/users/test/functional/users_controller_test.rb b/users/test/functional/users_controller_test.rb
index 0ce5cc2..96ae48c 100644
--- a/users/test/functional/users_controller_test.rb
+++ b/users/test/functional/users_controller_test.rb
@@ -59,19 +59,23 @@ class UsersControllerTest < ActionController::TestCase
assert_access_denied
end
- test "show for non-existing user" do
+ test "may not show non-existing user without auth" do
nonid = 'thisisnotanexistinguserid'
- # when unauthenticated:
get :show, :id => nonid
assert_access_denied(true, false)
+ end
- # when authenticated but not admin:
+ test "may not show non-existing user without admin" do
+ nonid = 'thisisnotanexistinguserid'
login
+
get :show, :id => nonid
assert_access_denied
+ end
- # when authenticated as admin:
+ test "redirect admin to user list for non-existing user" do
+ nonid = 'thisisnotanexistinguserid'
login :is_admin? => true
get :show, :id => nonid
assert_response :redirect