File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
spec/slack/web/api/mixins Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,12 @@ module Conversations
1212 #
1313 # @option options [channel] :channel
1414 # Channel to get ID for, prefixed with #.
15+ # @option options [integer] :limit
16+ # The page size used for conversations_list calls required to find the channel's ID
1517 def conversations_id ( options = { } )
1618 name = options [ :channel ]
19+ limit = options . fetch ( :limit , conversations_id_page_size )
20+
1721 raise ArgumentError , 'Required arguments :channel missing' if name . nil?
1822
1923 id_for (
@@ -23,7 +27,7 @@ def conversations_id(options = {})
2327 :conversations_list ,
2428 :channels ,
2529 'channel_not_found' ,
26- enum_method_options : { limit : conversations_id_page_size }
30+ enum_method_options : { limit : limit }
2731 )
2832 end
2933 end
Original file line number Diff line number Diff line change 3737 )
3838 end
3939
40+ it 'forwards a provided limit to the underlying conversations_list calls' do
41+ expect ( conversations ) . to receive ( :conversations_list ) . with ( limit : 1234 )
42+ conversations . conversations_id ( channel : '#general' , limit : 1234 )
43+ end
44+
4045 it 'fails with an exception' do
4146 expect { conversations . conversations_id ( channel : '#invalid' ) } . to (
4247 raise_error ( Slack ::Web ::Api ::Errors ::SlackError , 'channel_not_found' )
You can’t perform that action at this time.
0 commit comments