-
Notifications
You must be signed in to change notification settings - Fork 21
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
Allow passing API key to each request #53
Conversation
75ff16a
to
70d6ff3
Compare
70d6ff3
to
c57b29a
Compare
bb16757
to
f4c8954
Compare
@jperichon Added tests for get, put, post and delete requests. Api key is preset for all the tests, so these test overriding the one initially set. |
@nothingisfunny can we add a regression test to ensure that api key is removed from the params? Like this if the removal is removed from the code, tests will break. |
f4c8954
to
6f63c28
Compare
@jperichon These actually already test that. Inside expectation it checks what the params/payload is (I kept the original naming from other tests). I think right now for each request it would check that api_key is not passed as payload/params and also is not added as a query to the url. |
@mock.expects(:get).with do |url, headers, params| | ||
(url == "#{Checkr.api_base}#{MockResource.path}?page=1&filter=test%20filter" || | ||
url == "#{Checkr.api_base}#{MockResource.path}?filter=test%20filter&page=1") && | ||
params == nil && |
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.
@jperichon Here for example it checks that params are nil, so api_key was removed, and it also checks for the url to not include api_key as a query.
6f63c28
to
f84fac0
Compare
) | ||
end | ||
|
||
should 'allow passing an api_key as a param when the global api_key is NOT set' do |
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.
👍
f84fac0
to
7537da0
Compare
No description provided.