summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorazul <azul@riseup.net>2017-03-21 09:48:01 +0000
committerazul <azul@riseup.net>2017-03-21 09:48:01 +0000
commiteea0ee4bf0f662e202e2e7d7db264ff37634ea03 (patch)
treeb3b5abc48840e8dd82aeaf1b869391c49d2c9b78
parent987d1bf7c87f7ea3d17c40015b2ec92a8a0b4ecc (diff)
parent1115838e2acecd82fc2a13c55a631a8cfa42520e (diff)
Merge branch 'test/admin-user-api' into 'master'
test: admin user api always green Closes #17 See merge request !21
-rw-r--r--test/functional/api/users_controller_test.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/test/functional/api/users_controller_test.rb b/test/functional/api/users_controller_test.rb
index b69770d..88ecae0 100644
--- a/test/functional/api/users_controller_test.rb
+++ b/test/functional/api/users_controller_test.rb
@@ -95,11 +95,13 @@ class Api::UsersControllerTest < ApiControllerTest
end
test "admin can show is_admin property" do
- user = FactoryGirl.create :user, login: "admin2"
- login user
- api_get :show, :id => user.id, :format => :json
- assert_response :success
- assert_json_response user.to_hash.merge(:is_admin => true)
+ admin = FactoryGirl.create :user
+ with_config(admins: [admin.login]) do
+ login admin
+ api_get :show, :id => admin.id, :format => :json
+ assert_response :success
+ assert_json_response admin.to_hash.merge(:is_admin => true)
+ end
end
test "normal users cannot show user" do