Skip to content

Commit

Permalink
Integration tests for new user methods; various test and fixture adus…
Browse files Browse the repository at this point in the history
…tments
  • Loading branch information
joshcanhelp committed Jun 27, 2019
1 parent 1fca6aa commit a34db05
Show file tree
Hide file tree
Showing 131 changed files with 846 additions and 353 deletions.
2 changes: 1 addition & 1 deletion lib/auth0/api/v2/roles.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def remove_role_permissions(role_id, permissions)
raise Auth0::MissingParameter, 'Must supply a valid role_id' if role_id.to_s.empty?

permissions = validate_permissions_array(permissions)
delete_with_body "#{roles_path}/#{role_id}/permissions", permissions: permissions
delete_with_body("#{roles_path}/#{role_id}/permissions", permissions: permissions)
end

private
Expand Down
8 changes: 4 additions & 4 deletions lib/auth0/api/v2/users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -221,19 +221,19 @@ def remove_roles(user_id, roles)
raise Auth0::MissingUserId, 'Must supply a valid user_id' if user_id.to_s.empty?
validate_strings_array roles
path = "#{users_path}/#{user_id}/roles"
delete(path, { roles: roles })
delete_with_body path, roles: roles
end

# Add one or more roles to a specific user.
# @see https://auth0.com/docs/api/management/v2#!/Users/post_user_roles
#
# @param user_id [string] The user_id of the roles to add.
# @param roles [array] An array of role names to add.
# @param roles [array] An array of role ids to add.
def add_user_roles(user_id, roles)
raise Auth0::MissingUserId, 'Must supply a valid user_id' if user_id.to_s.empty?
validate_strings_array roles
path = "#{users_path}/#{user_id}/roles"
post(path, { roles: roles })
post(path, roles: roles)
end

# Get all Guardian enrollments for a specific user
Expand Down Expand Up @@ -266,7 +266,7 @@ def get_user_permissions(user_id)
def remove_user_permissions(user_id, permissions)
raise Auth0::MissingUserId, 'Must supply a valid user_id' if user_id.to_s.empty?
permissions = validate_permissions_array permissions
delete "#{users_path}/#{user_id}/permissions", permissions: permissions
delete_with_body "#{users_path}/#{user_id}/permissions", permissions: permissions
end

# Add one or more permissions from a specific user.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a34db05

Please sign in to comment.