Skip to content

Commit

Permalink
Pass client_id at Auth0::Api::V2::ClientGrants#client_grants
Browse files Browse the repository at this point in the history
  • Loading branch information
hkdnet committed Mar 30, 2020
1 parent 582c272 commit f363be3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/auth0/api/v2/client_grants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ module ClientGrants

# Retrieves a list of all client grants.
# @see https://auth0.com/docs/api/management/v2#!/client_grants/get_client_grants
# @param client_id [string] The client_id of the client grant to retrieve.
# @param page [int] Page number to get, 0-based.
# @param per_page [int] Results per page if also passing a page number.
# @return [json] Returns the client grants.
def client_grants (page: nil, per_page: nil)
def client_grants (client_id: nil, page: nil, per_page: nil)
request_params = {
client_id: client_id,
page: page,
per_page: per_page
}
Expand Down
4 changes: 3 additions & 1 deletion spec/lib/auth0/api/v2/client_grants_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
it 'is expected to get /api/v2/client-grants/' do
expect(@instance).to receive(:get).with(
'/api/v2/client-grants',
client_id: nil,
page: nil,
per_page: nil
)
Expand All @@ -22,10 +23,11 @@
it 'is expected to send get /api/v2/client-grants/ with pagination' do
expect(@instance).to receive(:get).with(
'/api/v2/client-grants',
client_id: '1',
page: 1,
per_page: 2
)
expect { @instance.client_grants(page: 1, per_page: 2) }.not_to raise_error
expect { @instance.client_grants(client_id: '1', page: 1, per_page: 2) }.not_to raise_error
end
end

Expand Down

0 comments on commit f363be3

Please sign in to comment.