File tree 3 files changed +12
-6
lines changed
3 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,3 @@ Metrics/MethodLength:
3
3
4
4
Metrics/LineLength :
5
5
Max : 121
6
-
7
- Metrics/AbcSize :
8
- Max : 15.5
Original file line number Diff line number Diff line change
1
+ # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
1
2
module Auth0
2
3
module Api
3
4
module V2
@@ -33,7 +34,10 @@ def logs(options = {})
33
34
take : options . fetch ( :take , nil )
34
35
}
35
36
if request_params [ :take ] . to_i > 100
36
- fail Auth0 ::MissingParameter , 'The total amount of entries should be less than 100'
37
+ fail Auth0 ::MissingParameter , 'The total amount of entries to retrieve should be less than 100'
38
+ end
39
+ if request_params [ :per_page ] . to_i > 100
40
+ fail Auth0 ::MissingParameter , 'The total amount of entries per page should be less than 100'
37
41
end
38
42
get ( logs_path , request_params )
39
43
end
Original file line number Diff line number Diff line change 24
24
expect { @instance . logs } . not_to raise_error
25
25
end
26
26
it 'is expect to rise an error when take is higher than 100' do
27
- expect ( @instance . logs ( take : rand ( 101 ...1000 ) ) ) . to raise_error (
28
- 'The total amount of entries should be less than 100' )
27
+ expect { @instance . logs ( take : rand ( 101 ..2000 ) ) } . to raise_error (
28
+ 'The total amount of entries to retrieve should be less than 100' )
29
+ end
30
+ it 'is expect to rise an error when per_page is higher than 100' do
31
+ expect { @instance . logs ( per_page : rand ( 101 ..2000 ) ) } . to raise_error (
32
+ 'The total amount of entries per page should be less than 100' )
29
33
end
30
34
end
31
35
36
40
expect ( @instance ) . to receive ( :get ) . with ( '/api/v2/logs/LOG_ID' )
37
41
expect { @instance . log ( 'LOG_ID' ) } . not_to raise_error
38
42
end
43
+ it { expect { @instance . log ( nil ) } . to raise_error ( 'Must supply a valid log_id' ) }
39
44
end
40
45
end
You can’t perform that action at this time.
0 commit comments