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 pagination and tests to Clients and Connections endpoints #113

Merged
merged 3 commits into from
Jun 21, 2018

Conversation

joshcanhelp
Copy link
Contributor

  • Add new :page and :per_page method parameters to Auth0::Api::V2::Clients and Auth0::Api::V2::Connections modules.
  • Add ability to pass an Array for the fields: parameter and convert to comma-sep string
  • Add tests for all changes above.

@joshcanhelp joshcanhelp requested a review from machuga June 20, 2018 18:34
}.not_to raise_error
end

it 'is expected to add pagination' do
Copy link

Choose a reason for hiding this comment

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

This is asserting something about adding pagination, but only tests that an error wasn't raised. Is there an indicator that the params weren't silently ignored?

Copy link
Contributor Author

@joshcanhelp joshcanhelp Jun 20, 2018

Choose a reason for hiding this comment

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

That first expect line sets up the second one. If you change the page value in with() to a different value, it fails.

@machuga
Copy link

machuga commented Jun 20, 2018 via email

@joshcanhelp
Copy link
Contributor Author

@machuga - As in, you can't tell if the results themselves are paginated? I can add an integration test for that.

But, for a unit test, I think this works ok. It was a bit of trial and error to get it to work but changing the values of, say, the page parameter on one or the other but not both would make the test fail. So that first expect is saying "make the instance get an endpoint with the following parameters" and the second calls that instance, causing an error if it does not meet the expectation. Source.

@machuga
Copy link

machuga commented Jun 21, 2018

Ya I think the test name just implies that something else is being tested. it ......

Copy link

@machuga machuga left a comment

Choose a reason for hiding this comment

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

LGTM

@joshcanhelp joshcanhelp added this to the v4-Next milestone Jun 21, 2018
@joshcanhelp joshcanhelp merged commit 61b9a3e into master Jun 21, 2018
@joshcanhelp joshcanhelp deleted the add-pagination-clients branch June 21, 2018 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants