-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Roles and Users endpoints integration tests #174
Conversation
6170d8a
to
579cf77
Compare
579cf77
to
7ff2375
Compare
7ff2375
to
6278b66
Compare
@@ -220,19 +221,19 @@ def remove_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" | |||
delete(path, { roles: roles }) | |||
delete_with_body path, roles: roles |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see inconsistencies on the syntax when calling a function with parameters.
delete(path, {param: value}
vs delete path, param:value
.
Should we add a linter as a precommit for this repo as well or is this change on purpose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a linter that I run, rubocop
, but it doesn't pick this up
@@ -20,6 +20,8 @@ module HTTPProxy | |||
call(:get, url(safe_path), timeout, get_headers) | |||
elsif method == :delete | |||
call(:delete, url(safe_path), timeout, add_headers({params: body})) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this params:body
header for? I guess you meant to send a query instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oddly, sending it as params:
converts it to a query ... one of the many quirks of this HTTP library
Changes
unlink_users_account
tounlink_user_account
, added alias and testdelete_with_body
method to send a body rather than params with aDELETE
requestNote for reviewers:
spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/
andspec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/
. Sensitive information (API token) is automatically filtered out.API_TOKEN
).References
Testing