Skip to content

Commit 62a5cca

Browse files
committed
FIXUP: tests
1 parent abffcb6 commit 62a5cca

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

spec/slack/web/api/mixins/conversations_spec.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,22 @@
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
5269
end

spec/slack/web/api/mixins/users_spec.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,21 @@
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)

0 commit comments

Comments
 (0)