Skip to content
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 VCR to and improve all integration tests #132

Merged
merged 1 commit into from
Oct 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .bundle/config
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
BUNDLE_JOBS: '4'
BUNDLE_BIN: bin
BUNDLE_JOBS: "3"
BUNDLE_BIN: "bin"
BUNDLE_RETRY: "3"
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ end

group :test do
gem 'webmock', require: false
gem 'vcr', require: false
end
2 changes: 1 addition & 1 deletion lib/auth0/api/v2/resource_servers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def resource_server(resource_server_id)
# @return [json] Returns the resource server.
def create_resource_server(identifier, options = {})
raise Auth0::InvalidParameter, 'Must supply a valid resource server id' if identifier.to_s.empty?
if ['<', '>'].include?(options.fetch(:name, ''))
if options.fetch(:name, '').index(/[<>]/)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was not actually checking for what it was trying to check for

raise Auth0::InvalidParameter, 'Name must contain at least one character. Does not allow "<" or ">"'
end
request_params = Hash[options.map { |(k, v)| [k.to_sym, v] }]
Expand Down
2 changes: 1 addition & 1 deletion lib/auth0/api/v2/users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def delete_user(user_id)
# @return [json] Returns the updated user.
def patch_user(user_id, body)
raise Auth0::MissingUserId, 'Must supply a valid user_id' if user_id.to_s.empty?
raise Auth0::InvalidParameter, 'Must supply a valid body' if body.to_s.empty?
raise Auth0::InvalidParameter, 'Must supply a valid body' if body.to_s.empty? || body.empty?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did not catch an empty hash

path = "#{users_path}/#{user_id}"
patch(path, body)
end
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.

Loading