File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
spec/slack/web/api/mixins Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 4848 raise_error ( Slack ::Web ::Api ::Errors ::SlackError , 'channel_not_found' )
4949 )
5050 end
51+
52+ context "when a non-default conversations_id page size has been configured" do
53+ before { Slack ::Web . config . conversations_id_page_size = 500 }
54+ after { Slack ::Web . config . reset }
55+
56+ it 'translates a channel that starts with a #' do
57+ expect ( conversations ) . to receive ( :conversations_list ) . with ( limit : 500 )
58+ expect ( conversations . conversations_id ( channel : '#general' ) ) . to (
59+ eq ( 'ok' => true , 'channel' => { 'id' => 'CDEADBEEF' } )
60+ )
61+ end
62+
63+ it 'forwards a provided limit to the underlying conversations_list calls' do
64+ expect ( conversations ) . to receive ( :conversations_list ) . with ( limit : 1234 )
65+ conversations . conversations_id ( channel : '#general' , id_limit : 1234 )
66+ end
67+ end
5168 end
5269end
Original file line number Diff line number Diff line change 4545 raise_error ( Slack ::Web ::Api ::Errors ::SlackError , 'user_not_found' )
4646 )
4747 end
48+
49+ context "when a non-default conversations_id page size has been configured" do
50+ before { Slack ::Web . config . users_id_page_size = 500 }
51+ after { Slack ::Web . config . reset }
52+
53+ it 'translates a user that starts with a @' do
54+ expect ( users ) . to receive ( :users_list ) . with ( limit : 500 )
55+ expect ( users . users_id ( user : '@aws' ) ) . to eq ( 'ok' => true , 'user' => { 'id' => 'UDEADBEEF' } )
56+ end
57+
58+ it 'forwards a provided limit to the underlying users_list calls' do
59+ expect ( users ) . to receive ( :users_list ) . with ( limit : 1234 )
60+ users . users_id ( user : '@aws' , id_limit : 1234 )
61+ end
62+ end
4863 end
4964
5065 if defined? ( Picky )
You can’t perform that action at this time.
0 commit comments