summaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorazul <azul@leap.se>2014-07-17 12:16:07 +0200
committerazul <azul@leap.se>2014-07-17 12:16:07 +0200
commitade74d8a9091ae607586d7b287a0579a2ee7af8e (patch)
tree74273b8ba7e35d0fb3c96aa79e63c93086d15146 /test/functional
parent952bc18e8333ca5c3e6e16f8059f84a1414d5f6f (diff)
parente86cccb4b89540f3bd403110d051b2723be781b9 (diff)
Merge pull request #176 from azul/feature/api-authenticated-configs
API: Authenticated access to config settings
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/application_controller_test.rb4
-rw-r--r--test/functional/users_controller_test.rb2
-rw-r--r--test/functional/v1/messages_controller_test.rb2
-rw-r--r--test/functional/v1/users_controller_test.rb4
4 files changed, 7 insertions, 5 deletions
diff --git a/test/functional/application_controller_test.rb b/test/functional/application_controller_test.rb
index c4c922b..b558ad8 100644
--- a/test/functional/application_controller_test.rb
+++ b/test/functional/application_controller_test.rb
@@ -9,13 +9,13 @@ class ApplicationControllerTest < ActionController::TestCase
def test_require_login_redirect
@controller.send(:require_login)
- assert_access_denied(true, false)
+ assert_login_required
end
def test_require_login
login
@controller.send(:require_login)
- assert_access_denied(false)
+ assert_access_granted
end
def test_require_admin
diff --git a/test/functional/users_controller_test.rb b/test/functional/users_controller_test.rb
index 4af9ca6..7d1745c 100644
--- a/test/functional/users_controller_test.rb
+++ b/test/functional/users_controller_test.rb
@@ -52,7 +52,7 @@ class UsersControllerTest < ActionController::TestCase
nonid = 'thisisnotanexistinguserid'
get :show, :id => nonid
- assert_access_denied(true, false)
+ assert_login_required
end
test "may not show non-existing user without admin" do
diff --git a/test/functional/v1/messages_controller_test.rb b/test/functional/v1/messages_controller_test.rb
index 24a5b1f..a50fded 100644
--- a/test/functional/v1/messages_controller_test.rb
+++ b/test/functional/v1/messages_controller_test.rb
@@ -51,7 +51,7 @@ class V1::MessagesControllerTest < ActionController::TestCase
test "fails if not authenticated" do
get :index, :format => :json
- assert_access_denied
+ assert_login_required
end
end
diff --git a/test/functional/v1/users_controller_test.rb b/test/functional/v1/users_controller_test.rb
index fe3cfe7..ffe2484 100644
--- a/test/functional/v1/users_controller_test.rb
+++ b/test/functional/v1/users_controller_test.rb
@@ -34,7 +34,9 @@ class V1::UsersControllerTest < ActionController::TestCase
test "user cannot update other user" do
user = find_record :user
login
- put :update, :user => record_attributes_for(:user_with_settings), :id => user.id, :format => :json
+ put :update, id: user.id,
+ user: record_attributes_for(:user_with_settings),
+ :format => :json
assert_access_denied
end