slack-ruby-client 0.16.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/danger.yml +19 -0
- data/.github/workflows/integtest.yml +25 -0
- data/.github/workflows/rubocop.yml +13 -0
- data/.github/workflows/test.yml +34 -0
- data/.gitignore +5 -3
- data/.rubocop.yml +6 -0
- data/.rubocop_todo.yml +137 -43
- data/CHANGELOG.md +34 -3
- data/CONTRIBUTING.md +4 -4
- data/Gemfile +18 -1
- data/Gemfile.danger +6 -0
- data/LICENSE.md +1 -1
- data/README.md +13 -12
- data/RELEASING.md +1 -1
- data/UPGRADING.md +42 -0
- data/bin/commands/admin_analytics.rb +2 -1
- data/bin/commands/admin_apps.rb +11 -0
- data/bin/commands/admin_apps_requests.rb +12 -0
- data/bin/commands/admin_auth_policy.rb +39 -0
- data/bin/commands/admin_conversations.rb +2 -1
- data/bin/commands/admin_conversations_restrictAccess.rb +1 -1
- data/bin/commands/admin_emoji.rb +2 -2
- data/bin/commands/admin_teams.rb +1 -1
- data/bin/commands/admin_users.rb +1 -0
- data/bin/commands/admin_users_session.rb +40 -0
- data/bin/commands/admin_users_unsupportedVersions.rb +15 -0
- data/bin/commands/apps_manifest.rb +52 -0
- data/bin/commands/bookmarks.rb +52 -0
- data/bin/commands/channels.rb +0 -157
- data/bin/commands/chat.rb +14 -9
- data/bin/commands/conversations.rb +61 -4
- data/bin/commands/dnd.rb +3 -1
- data/bin/commands/files.rb +2 -1
- data/bin/commands/groups.rb +0 -163
- data/bin/commands/im.rb +0 -62
- data/bin/commands/mpim.rb +0 -60
- data/bin/commands/oauth.rb +0 -13
- data/bin/commands/oauth_v2.rb +13 -1
- data/bin/commands/openid_connect.rb +27 -0
- data/bin/commands/pins.rb +2 -2
- data/bin/commands/reminders.rb +6 -0
- data/bin/commands/rtm.rb +2 -2
- data/bin/commands/search.rb +2 -1
- data/bin/commands/stars.rb +7 -6
- data/bin/commands/team.rb +1 -0
- data/bin/commands/team_billing.rb +13 -0
- data/bin/commands/team_preferences.rb +13 -0
- data/bin/commands/tooling_tokens.rb +14 -0
- data/bin/commands/usergroups.rb +1 -1
- data/bin/commands/users.rb +1 -1
- data/bin/commands/views.rb +1 -1
- data/bin/commands.rb +8 -9
- data/lib/slack/config.rb +1 -2
- data/lib/slack/events/request.rb +5 -3
- data/lib/slack/real_time/client.rb +6 -7
- data/lib/slack/real_time/concurrency/async.rb +6 -8
- data/lib/slack/real_time/config.rb +3 -13
- data/lib/slack/real_time/socket.rb +1 -2
- data/lib/slack/real_time/stores/base.rb +1 -6
- data/lib/slack/real_time/stores/starter.rb +6 -3
- data/lib/slack/real_time/stores/store.rb +5 -0
- data/lib/slack/version.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_analytics.rb +5 -3
- data/lib/slack/web/api/endpoints/admin_apps.rb +21 -5
- data/lib/slack/web/api/endpoints/admin_apps_approved.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_apps_requests.rb +20 -2
- data/lib/slack/web/api/endpoints/admin_apps_restricted.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_auth_policy.rb +72 -0
- data/lib/slack/web/api/endpoints/admin_barriers.rb +6 -6
- data/lib/slack/web/api/endpoints/admin_conversations.rb +28 -26
- data/lib/slack/web/api/endpoints/admin_conversations_ekm.rb +4 -4
- data/lib/slack/web/api/endpoints/admin_emoji.rb +11 -11
- data/lib/slack/web/api/endpoints/admin_inviteRequests.rb +7 -7
- data/lib/slack/web/api/endpoints/admin_inviteRequests_approved.rb +3 -3
- data/lib/slack/web/api/endpoints/admin_inviteRequests_denied.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_teams.rb +7 -7
- data/lib/slack/web/api/endpoints/admin_teams_admins.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_teams_owners.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_teams_settings.rb +5 -5
- data/lib/slack/web/api/endpoints/admin_usergroups.rb +10 -10
- data/lib/slack/web/api/endpoints/admin_users.rb +20 -18
- data/lib/slack/web/api/endpoints/admin_users_session.rb +65 -9
- data/lib/slack/web/api/endpoints/admin_users_unsupportedVersions.rb +25 -0
- data/lib/slack/web/api/endpoints/api.rb +1 -1
- data/lib/slack/web/api/endpoints/apps.rb +2 -2
- data/lib/slack/web/api/endpoints/apps_event_authorizations.rb +3 -3
- data/lib/slack/web/api/endpoints/apps_manifest.rb +77 -0
- data/lib/slack/web/api/endpoints/auth.rb +1 -1
- data/lib/slack/web/api/endpoints/auth_teams.rb +3 -3
- data/lib/slack/web/api/endpoints/bookmarks.rb +86 -0
- data/lib/slack/web/api/endpoints/bots.rb +2 -2
- data/lib/slack/web/api/endpoints/calls.rb +15 -15
- data/lib/slack/web/api/endpoints/calls_participants.rb +4 -4
- data/lib/slack/web/api/endpoints/channels.rb +0 -265
- data/lib/slack/web/api/endpoints/chat.rb +67 -57
- data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +3 -3
- data/lib/slack/web/api/endpoints/conversations.rb +117 -27
- data/lib/slack/web/api/endpoints/dialog.rb +2 -2
- data/lib/slack/web/api/endpoints/dnd.rb +6 -3
- data/lib/slack/web/api/endpoints/files.rb +16 -14
- data/lib/slack/web/api/endpoints/files_comments.rb +1 -1
- data/lib/slack/web/api/endpoints/files_remote.rb +20 -20
- data/lib/slack/web/api/endpoints/groups.rb +0 -273
- data/lib/slack/web/api/endpoints/im.rb +0 -107
- data/lib/slack/web/api/endpoints/migration.rb +3 -3
- data/lib/slack/web/api/endpoints/mpim.rb +0 -102
- data/lib/slack/web/api/endpoints/oauth.rb +5 -27
- data/lib/slack/web/api/endpoints/oauth_v2.rb +24 -6
- data/lib/slack/web/api/endpoints/openid_connect.rb +42 -0
- data/lib/slack/web/api/endpoints/pins.rb +4 -4
- data/lib/slack/web/api/endpoints/reactions.rb +12 -12
- data/lib/slack/web/api/endpoints/reminders.rb +17 -5
- data/lib/slack/web/api/endpoints/rtm.rb +10 -10
- data/lib/slack/web/api/endpoints/search.rb +24 -16
- data/lib/slack/web/api/endpoints/stars.rb +11 -9
- data/lib/slack/web/api/endpoints/team.rb +10 -8
- data/lib/slack/web/api/endpoints/team_billing.rb +21 -0
- data/lib/slack/web/api/endpoints/team_preferences.rb +21 -0
- data/lib/slack/web/api/endpoints/team_profile.rb +1 -1
- data/lib/slack/web/api/endpoints/tooling_tokens.rb +24 -0
- data/lib/slack/web/api/endpoints/usergroups.rb +19 -19
- data/lib/slack/web/api/endpoints/usergroups_users.rb +7 -7
- data/lib/slack/web/api/endpoints/users.rb +16 -16
- data/lib/slack/web/api/endpoints/users_profile.rb +4 -4
- data/lib/slack/web/api/endpoints/views.rb +12 -12
- data/lib/slack/web/api/endpoints/workflows.rb +9 -9
- data/lib/slack/web/api/endpoints.rb +16 -20
- data/lib/slack/web/api/errors/server_error.rb +37 -0
- data/lib/slack/web/api/errors/too_many_requests_error.rb +1 -4
- data/lib/slack/web/api/errors.rb +232 -16
- data/lib/slack/web/api/mixins.rb +0 -2
- data/lib/slack/web/api/patches/chat.1.patch +7 -9
- data/lib/slack/web/api/templates/endpoints.erb +0 -2
- data/lib/slack/web/faraday/connection.rb +5 -5
- data/lib/slack/web/faraday/request.rb +4 -1
- data/lib/slack/web/faraday/response/raise_error.rb +2 -14
- data/lib/slack/web/faraday/response/wrap_error.rb +11 -5
- data/lib/slack/web/pagination/cursor.rb +1 -5
- data/lib/slack-ruby-client.rb +3 -2
- data/lib/tasks/real_time.rake +1 -3
- data/lib/tasks/web.rake +4 -0
- data/slack-ruby-client.gemspec +5 -14
- data/spec/fixtures/slack/web/429_error.yml +50 -54
- data/spec/fixtures/slack/web/auth_test_error.yml +51 -18
- data/spec/fixtures/slack/web/auth_test_success.yml +50 -26
- data/spec/fixtures/slack/web/conversations_info.yml +167 -0
- data/spec/fixtures/slack/web/conversations_setTopic.yml +42 -27
- data/spec/fixtures/slack/web/conversations_setTopic_one_page.yml +89 -59
- data/spec/fixtures/slack/web/conversations_setTopic_paginated.yml +131 -86
- data/spec/fixtures/slack/web/paginated_users_list.yml +501 -69
- data/spec/fixtures/slack/web/rtm_connect.yml +267 -30
- data/spec/fixtures/slack/web/rtm_start.yml +771 -60
- data/spec/fixtures/slack/web/users_info.yml +153 -69
- data/spec/fixtures/slack/web/users_list.yml +102 -41
- data/spec/fixtures/slack/web/views_open_error.yml +49 -42
- data/spec/integration/integration_spec.rb +1 -1
- data/spec/slack/events/request_spec.rb +7 -6
- data/spec/slack/real_time/client_spec.rb +37 -39
- data/spec/slack/real_time/concurrency/with_concurrency_spec.rb +10 -0
- data/spec/slack/real_time/concurrency/without_concurrency_spec.rb +10 -0
- data/spec/slack/real_time/event_handlers/bot_spec.rb +1 -1
- data/spec/slack/real_time/event_handlers/channel_spec.rb +9 -9
- data/spec/slack/real_time/event_handlers/group_spec.rb +2 -2
- data/spec/slack/real_time/event_handlers/im_spec.rb +7 -7
- data/spec/slack/real_time/event_handlers/user_spec.rb +2 -2
- data/spec/slack/real_time/rtm_connect_spec.rb +1 -1
- data/spec/slack/real_time/rtm_start_spec.rb +1 -1
- data/spec/slack/real_time/store_spec.rb +2 -2
- data/spec/slack/slack_spec.rb +7 -5
- data/spec/slack/version_spec.rb +1 -1
- data/spec/slack/web/api/endpoints/admin_apps_requests_spec.rb +5 -0
- data/spec/slack/web/api/endpoints/admin_apps_spec.rb +5 -0
- data/spec/slack/web/api/endpoints/admin_auth_policy_spec.rb +35 -0
- data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +9 -9
- data/spec/slack/web/api/endpoints/admin_teams_settings_spec.rb +1 -1
- data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +6 -6
- data/spec/slack/web/api/endpoints/admin_users_session_spec.rb +22 -2
- data/spec/slack/web/api/endpoints/admin_users_spec.rb +8 -8
- data/spec/slack/web/api/endpoints/admin_users_unsupportedVersions_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/apps_manifest_spec.rb +36 -0
- data/spec/slack/web/api/endpoints/apps_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/bookmarks_spec.rb +40 -0
- data/spec/slack/web/api/endpoints/calls_participants_spec.rb +4 -4
- data/spec/slack/web/api/endpoints/calls_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/custom_specs/auth_spec.rb +4 -6
- data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +28 -16
- data/spec/slack/web/api/endpoints/custom_specs/conversations_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb +4 -2
- data/spec/slack/web/api/endpoints/custom_specs/users_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/custom_specs/views_spec.rb +22 -14
- data/spec/slack/web/api/endpoints/dnd_spec.rb +0 -5
- data/spec/slack/web/api/endpoints/files_comments_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/files_remote_spec.rb +3 -3
- data/spec/slack/web/api/endpoints/oauth_spec.rb +0 -11
- data/spec/slack/web/api/endpoints/oauth_v2_spec.rb +6 -3
- data/spec/slack/web/api/endpoints/{apps_permissions_scopes_spec.rb → openid_connect_spec.rb} +1 -1
- data/spec/slack/web/api/endpoints/reactions_spec.rb +3 -3
- data/spec/slack/web/api/endpoints/reminders_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/{apps_permissions_resources_spec.rb → team_billing_spec.rb} +1 -1
- data/spec/slack/web/api/endpoints/team_preferences_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/tooling_tokens_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/usergroups_users_spec.rb +2 -2
- data/spec/slack/web/api/error_spec.rb +5 -7
- data/spec/slack/web/api/errors/slack_error_spec.rb +21 -26
- data/spec/slack/web/api/mixins/conversations_list_spec.rb +1 -1
- data/spec/slack/web/api/pagination/cursor_spec.rb +8 -10
- data/spec/slack/web/client_spec.rb +46 -32
- data/spec/slack/web/faraday/request_spec.rb +80 -0
- data/spec/slack/web/faraday/response/raise_error_spec.rb +2 -1
- data/spec/spec_helper.rb +1 -1
- data/spec/support/real_time/connected_client.rb +2 -8
- data/spec/support/vcr.rb +33 -2
- metadata +50 -297
- data/.travis.yml +0 -28
- data/lib/slack/web/api/errors/internal_error.rb +0 -14
- data/lib/slack/web/api/mixins/channels.id.json +0 -20
- data/lib/slack/web/api/mixins/channels.id.rb +0 -25
- data/lib/slack/web/api/mixins/groups.id.json +0 -20
- data/lib/slack/web/api/mixins/groups.id.rb +0 -25
- data/spec/fixtures/slack/web/503_error.yml +0 -14
- data/spec/fixtures/slack/web/channels_info.yml +0 -139
- data/spec/fixtures/slack/web/groups_info.yml +0 -43
- data/spec/slack/web/api/endpoints/admin_conversations_whitelist_spec.rb +0 -32
- data/spec/slack/web/api/endpoints/apps_permissions_spec.rb +0 -16
- data/spec/slack/web/api/endpoints/apps_permissions_users_spec.rb +0 -19
- data/spec/slack/web/api/endpoints/conversations_spec.rb +0 -109
- data/spec/slack/web/api/endpoints/custom_specs/channels_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/custom_specs/groups_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/im_spec.rb +0 -39
- data/spec/slack/web/api/endpoints/mpim_spec.rb +0 -39
- data/spec/slack/web/api/endpoints/views_spec.rb +0 -29
- data/spec/slack/web/api/mixins/channels_spec.rb +0 -43
- data/spec/slack/web/api/mixins/groups_spec.rb +0 -43
@@ -5,10 +5,12 @@ RSpec.describe Slack::RealTime::Client do
|
|
5
5
|
let(:ws) { double(Slack::RealTime::Concurrency::Mock::WebSocket, on: true) }
|
6
6
|
|
7
7
|
before do
|
8
|
+
# supports passing tests in CI even with an actual SLACK_API_TOKEN set
|
8
9
|
@token = ENV.delete('SLACK_API_TOKEN')
|
9
10
|
Slack::Config.reset
|
10
11
|
Slack::RealTime::Config.reset
|
11
12
|
Slack::RealTime.configure do |config|
|
13
|
+
config.token = '<SLACK_API_TOKEN>'
|
12
14
|
config.concurrency = Slack::RealTime::Concurrency::Mock
|
13
15
|
end
|
14
16
|
end
|
@@ -18,16 +20,10 @@ RSpec.describe Slack::RealTime::Client do
|
|
18
20
|
end
|
19
21
|
|
20
22
|
context 'token' do
|
21
|
-
before do
|
22
|
-
Slack.configure do |config|
|
23
|
-
config.token = 'global default'
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
23
|
it 'defaults token to global default' do
|
28
24
|
client = described_class.new
|
29
|
-
expect(client.token).to eq '
|
30
|
-
expect(client.web_client.token).to eq '
|
25
|
+
expect(client.token).to eq '<SLACK_API_TOKEN>'
|
26
|
+
expect(client.web_client.token).to eq '<SLACK_API_TOKEN>'
|
31
27
|
end
|
32
28
|
context 'with real time config' do
|
33
29
|
before do
|
@@ -70,14 +66,14 @@ RSpec.describe Slack::RealTime::Client do
|
|
70
66
|
context 'client with a full store',
|
71
67
|
vcr: { cassette_name: 'web/rtm_start', allow_playback_repeats: true } do
|
72
68
|
let(:client) { described_class.new(store_class: Slack::RealTime::Stores::Store) }
|
73
|
-
let(:url) { 'wss://
|
69
|
+
let(:url) { 'wss://cerberus-xxxx.lb.slack-msgs.com/websocket/uid' }
|
74
70
|
|
75
71
|
describe '#start!' do
|
76
72
|
let(:socket) { double(Slack::RealTime::Socket, connected?: true) }
|
77
73
|
|
78
74
|
before do
|
79
75
|
allow(Slack::RealTime::Socket).to(
|
80
|
-
receive(:new).with(url, ping: 30, logger: Slack::Logger.default).and_return(socket)
|
76
|
+
receive(:new).with(url, { ping: 30, logger: Slack::Logger.default }).and_return(socket)
|
81
77
|
)
|
82
78
|
allow(socket).to receive(:connect!)
|
83
79
|
allow(socket).to receive(:start_sync)
|
@@ -96,22 +92,22 @@ RSpec.describe Slack::RealTime::Client do
|
|
96
92
|
expect(client.teams.values.first).to eq client.team
|
97
93
|
end
|
98
94
|
it 'sets self' do
|
99
|
-
expect(client.self.id).to eq '
|
95
|
+
expect(client.self.id).to eq 'U0J1GAHN1'
|
100
96
|
end
|
101
97
|
it 'sets users' do
|
102
|
-
expect(client.users.count).to eq
|
103
|
-
expect(client.users.values.first['id']).to eq '
|
98
|
+
expect(client.users.count).to eq 35
|
99
|
+
expect(client.users.values.first['id']).to eq 'U0J1GAHN1'
|
104
100
|
end
|
105
101
|
it 'sets channels' do
|
106
|
-
expect(client.channels.count).to eq
|
107
|
-
expect(client.channels.values.first['name']).to eq '
|
102
|
+
expect(client.channels.count).to eq 156
|
103
|
+
expect(client.channels.values.first['name']).to eq 'general'
|
108
104
|
end
|
109
105
|
it 'sets ims' do
|
110
|
-
expect(client.ims.count).to eq
|
111
|
-
expect(client.ims.values.first['user']).to eq '
|
106
|
+
expect(client.ims.count).to eq 10
|
107
|
+
expect(client.ims.values.first['user']).to eq 'U04KB5WQR'
|
112
108
|
end
|
113
109
|
it 'sets bots' do
|
114
|
-
expect(client.bots.count).to eq
|
110
|
+
expect(client.bots.count).to eq 83
|
115
111
|
expect(client.bots.values.first['name']).to eq 'bot'
|
116
112
|
end
|
117
113
|
it 'sets groups' do
|
@@ -128,7 +124,7 @@ RSpec.describe Slack::RealTime::Client do
|
|
128
124
|
expect(client.web_client).to be_a Slack::Web::Client
|
129
125
|
end
|
130
126
|
it 'remembers socket' do
|
131
|
-
expect(client.instance_variable_get(
|
127
|
+
expect(client.instance_variable_get(:@socket)).to eq socket
|
132
128
|
end
|
133
129
|
it 'cannot be invoked twice' do
|
134
130
|
expect do
|
@@ -142,7 +138,7 @@ RSpec.describe Slack::RealTime::Client do
|
|
142
138
|
end
|
143
139
|
|
144
140
|
it 'cannot be invoked twice' do
|
145
|
-
client.instance_variable_set(
|
141
|
+
client.instance_variable_set(:@socket, nil) # caused by a :close callback
|
146
142
|
expect do
|
147
143
|
client.stop!
|
148
144
|
end.to raise_error Slack::RealTime::Client::ClientNotStartedError
|
@@ -179,7 +175,7 @@ RSpec.describe Slack::RealTime::Client do
|
|
179
175
|
end
|
180
176
|
|
181
177
|
it 'returns false when event is nil' do
|
182
|
-
expect(client.send(:run_handlers, 'example', {})).to
|
178
|
+
expect(client.send(:run_handlers, 'example', {})).to be_nil
|
183
179
|
end
|
184
180
|
end
|
185
181
|
end
|
@@ -190,7 +186,7 @@ RSpec.describe Slack::RealTime::Client do
|
|
190
186
|
|
191
187
|
before do
|
192
188
|
allow(Slack::RealTime::Socket).to(
|
193
|
-
receive(:new).with(url, ping: 30, logger: Slack::Logger.default).and_return(socket)
|
189
|
+
receive(:new).with(url, { ping: 30, logger: Slack::Logger.default }).and_return(socket)
|
194
190
|
)
|
195
191
|
allow(socket).to receive(:connect!)
|
196
192
|
allow(socket).to receive(:start_async)
|
@@ -252,14 +248,14 @@ RSpec.describe Slack::RealTime::Client do
|
|
252
248
|
|
253
249
|
context 'client with starter store', vcr: { cassette_name: 'web/rtm_connect' } do
|
254
250
|
let(:client) { described_class.new(store_class: Slack::RealTime::Stores::Starter) }
|
255
|
-
let(:url) { 'wss://
|
251
|
+
let(:url) { 'wss://cerberus-xxxx.lb.slack-msgs.com/websocket/uid' }
|
256
252
|
|
257
253
|
describe '#start!' do
|
258
254
|
let(:socket) { double(Slack::RealTime::Socket, connected?: true) }
|
259
255
|
|
260
256
|
before do
|
261
257
|
allow(Slack::RealTime::Socket).to(
|
262
|
-
receive(:new).with(url, ping: 30, logger: Slack::Logger.default).and_return(socket)
|
258
|
+
receive(:new).with(url, { ping: 30, logger: Slack::Logger.default }).and_return(socket)
|
263
259
|
)
|
264
260
|
allow(socket).to receive(:connect!)
|
265
261
|
allow(socket).to receive(:start_sync)
|
@@ -274,7 +270,7 @@ RSpec.describe Slack::RealTime::Client do
|
|
274
270
|
expect(client.team.domain).to eq 'dblockdotorg'
|
275
271
|
end
|
276
272
|
it 'sets self' do
|
277
|
-
expect(client.self.id).to eq '
|
273
|
+
expect(client.self.id).to eq 'U0J1GAHN1'
|
278
274
|
end
|
279
275
|
it 'no users' do
|
280
276
|
expect(client.users).to be_nil
|
@@ -305,7 +301,7 @@ RSpec.describe Slack::RealTime::Client do
|
|
305
301
|
expect(client.web_client).to be_a Slack::Web::Client
|
306
302
|
end
|
307
303
|
it 'remembers socket' do
|
308
|
-
expect(client.instance_variable_get(
|
304
|
+
expect(client.instance_variable_get(:@socket)).to eq socket
|
309
305
|
end
|
310
306
|
it 'cannot be invoked twice' do
|
311
307
|
expect do
|
@@ -319,7 +315,7 @@ RSpec.describe Slack::RealTime::Client do
|
|
319
315
|
end
|
320
316
|
|
321
317
|
it 'cannot be invoked twice' do
|
322
|
-
client.instance_variable_set(
|
318
|
+
client.instance_variable_set(:@socket, nil) # caused by a :close callback
|
323
319
|
expect do
|
324
320
|
client.stop!
|
325
321
|
end.to raise_error Slack::RealTime::Client::ClientNotStartedError
|
@@ -340,7 +336,7 @@ RSpec.describe Slack::RealTime::Client do
|
|
340
336
|
let(:url) { 'wss://mpmulti-w5tz.slack-msgs.com/websocket/uid' }
|
341
337
|
|
342
338
|
it 'sets store to nil' do
|
343
|
-
expect(client.store).to
|
339
|
+
expect(client.store).to be_nil
|
344
340
|
end
|
345
341
|
it "doesn't handle events" do
|
346
342
|
event = Slack::RealTime::Event.new(
|
@@ -351,10 +347,10 @@ RSpec.describe Slack::RealTime::Client do
|
|
351
347
|
client.send(:dispatch, event)
|
352
348
|
end
|
353
349
|
it 'self' do
|
354
|
-
expect(client.self).to
|
350
|
+
expect(client.self).to be_nil
|
355
351
|
end
|
356
352
|
it 'team' do
|
357
|
-
expect(client.team).to
|
353
|
+
expect(client.team).to be_nil
|
358
354
|
end
|
359
355
|
describe 'to_s' do
|
360
356
|
it 'defaults to class instance' do
|
@@ -371,7 +367,7 @@ RSpec.describe Slack::RealTime::Client do
|
|
371
367
|
expect(client.websocket_ping).to eq 30
|
372
368
|
end
|
373
369
|
it "doesn't set proxy" do
|
374
|
-
expect(client.websocket_proxy).to
|
370
|
+
expect(client.websocket_proxy).to be_nil
|
375
371
|
end
|
376
372
|
it 'defaults logger' do
|
377
373
|
expect(client.send(:logger)).to be_a ::Logger
|
@@ -379,7 +375,7 @@ RSpec.describe Slack::RealTime::Client do
|
|
379
375
|
it 'sets default store_class' do
|
380
376
|
expect(client.send(:store_class)).to eq Slack::RealTime::Store
|
381
377
|
end
|
382
|
-
(Slack::RealTime::Config::ATTRIBUTES - %i[logger store_class]).each do |key|
|
378
|
+
(Slack::RealTime::Config::ATTRIBUTES - %i[logger store_class token]).each do |key|
|
383
379
|
it "sets #{key}" do
|
384
380
|
expect(client.send(key)).to eq Slack::RealTime::Config.send(key)
|
385
381
|
end
|
@@ -431,7 +427,7 @@ RSpec.describe Slack::RealTime::Client do
|
|
431
427
|
described_class.config.reset
|
432
428
|
end
|
433
429
|
|
434
|
-
let(:url) { 'wss://
|
430
|
+
let(:url) { 'wss://cerberus-xxxx.lb.slack-msgs.com/websocket/uid' }
|
435
431
|
let(:client) { described_class.new }
|
436
432
|
|
437
433
|
context 'ping' do
|
@@ -447,7 +443,7 @@ RSpec.describe Slack::RealTime::Client do
|
|
447
443
|
end
|
448
444
|
it 'creates a connection with custom ping', vcr: { cassette_name: 'web/rtm_start' } do
|
449
445
|
expect(Slack::RealTime::Concurrency::Mock::WebSocket).to(
|
450
|
-
receive(:new).with(url, nil, ping: 15).and_return(ws)
|
446
|
+
receive(:new).with(url, nil, { ping: 15 }).and_return(ws)
|
451
447
|
)
|
452
448
|
client.start!
|
453
449
|
end
|
@@ -478,10 +474,12 @@ RSpec.describe Slack::RealTime::Client do
|
|
478
474
|
expect(Slack::RealTime::Concurrency::Mock::WebSocket).to receive(:new).with(
|
479
475
|
url,
|
480
476
|
nil,
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
477
|
+
{
|
478
|
+
ping: 30,
|
479
|
+
proxy: {
|
480
|
+
origin: 'http://username:password@proxy.example.com',
|
481
|
+
headers: { 'User-Agent' => 'ruby' }
|
482
|
+
}
|
485
483
|
}
|
486
484
|
).and_return(ws)
|
487
485
|
client.start!
|
@@ -511,7 +509,7 @@ RSpec.describe Slack::RealTime::Client do
|
|
511
509
|
|
512
510
|
it 'calls rtm_start with start options', vcr: { cassette_name: 'web/rtm_start' } do
|
513
511
|
expect(client.web_client).to(
|
514
|
-
receive(:rtm_start).with(simple_latest: true).and_call_original
|
512
|
+
receive(:rtm_start).with({ simple_latest: true }).and_call_original
|
515
513
|
)
|
516
514
|
client.start!
|
517
515
|
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
RSpec.describe 'with CONCURRENCY', skip: ( # rubocop:disable RSpec/DescribeClass
|
5
|
+
(!ENV['CONCURRENCY']) && 'missing CONCURRENCY'
|
6
|
+
) do
|
7
|
+
it 'detects concurrency' do
|
8
|
+
expect(Slack::RealTime::Config.concurrency).to eq Slack::RealTime::Concurrency::Async
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
RSpec.describe 'without CONCURRENCY', skip: ( # rubocop:disable RSpec/DescribeClass
|
5
|
+
(ENV['CONCURRENCY']) && 'CONCURRENCY is set'
|
6
|
+
) do
|
7
|
+
it 'raises NoConcurrencyError' do
|
8
|
+
expect { Slack::RealTime::Config.concurrency }.to raise_error Slack::RealTime::Config::NoConcurrencyError
|
9
|
+
end
|
10
|
+
end
|
@@ -6,7 +6,7 @@ RSpec.describe Slack::RealTime::Client, vcr: { cassette_name: 'web/rtm_start' }
|
|
6
6
|
|
7
7
|
context 'channel' do
|
8
8
|
it 'sets channel data' do
|
9
|
-
expect(client.channels.count).to eq
|
9
|
+
expect(client.channels.count).to eq 156
|
10
10
|
end
|
11
11
|
it 'channel_archive' do
|
12
12
|
channel = client.channels['C0HNTD0CW']
|
@@ -20,7 +20,7 @@ RSpec.describe Slack::RealTime::Client, vcr: { cassette_name: 'web/rtm_start' }
|
|
20
20
|
expect(channel.is_archived).to be true
|
21
21
|
end
|
22
22
|
it 'channel_created' do
|
23
|
-
expect(client.channels['C024BE91L']).to
|
23
|
+
expect(client.channels['C024BE91L']).to be_nil
|
24
24
|
event = Slack::RealTime::Event.new(
|
25
25
|
'type' => 'channel_created',
|
26
26
|
'channel' => {
|
@@ -32,23 +32,23 @@ RSpec.describe Slack::RealTime::Client, vcr: { cassette_name: 'web/rtm_start' }
|
|
32
32
|
)
|
33
33
|
client.send(:dispatch, event)
|
34
34
|
channel = client.channels['C024BE91L']
|
35
|
-
expect(channel).not_to
|
35
|
+
expect(channel).not_to be_nil
|
36
36
|
expect(channel.name).to eq 'fun'
|
37
37
|
expect(channel.creator).to eq 'U04KB5WQR'
|
38
38
|
expect(channel.created).to eq 1_360_782_804
|
39
39
|
end
|
40
40
|
it 'channel_deleted' do
|
41
|
-
expect(client.channels['C0HLE0BBL']).not_to
|
41
|
+
expect(client.channels['C0HLE0BBL']).not_to be_nil
|
42
42
|
event = Slack::RealTime::Event.new(
|
43
43
|
'type' => 'channel_deleted',
|
44
44
|
'channel' => 'C0HLE0BBL'
|
45
45
|
)
|
46
46
|
client.send(:dispatch, event)
|
47
|
-
expect(client.channels['C0HLE0BBL']).to
|
47
|
+
expect(client.channels['C0HLE0BBL']).to be_nil
|
48
48
|
end
|
49
49
|
context 'channel_joined' do
|
50
50
|
it 'creates channel' do
|
51
|
-
expect(client.channels['CDEADBEEF']).to
|
51
|
+
expect(client.channels['CDEADBEEF']).to be_nil
|
52
52
|
event = Slack::RealTime::Event.new(
|
53
53
|
'type' => 'channel_joined',
|
54
54
|
'channel' => {
|
@@ -58,11 +58,11 @@ RSpec.describe Slack::RealTime::Client, vcr: { cassette_name: 'web/rtm_start' }
|
|
58
58
|
)
|
59
59
|
client.send(:dispatch, event)
|
60
60
|
channel = client.channels['CDEADBEEF']
|
61
|
-
expect(channel).not_to
|
61
|
+
expect(channel).not_to be_nil
|
62
62
|
expect(channel.name).to eq 'beef'
|
63
63
|
end
|
64
64
|
it 'updates channel' do
|
65
|
-
expect(client.channels['CDEADBEEF']).to
|
65
|
+
expect(client.channels['CDEADBEEF']).to be_nil
|
66
66
|
client.channels['CDEADBEEF'] =
|
67
67
|
Slack::RealTime::Models::Channel.new('id' => 'CDEADBEEF', name: 'beef')
|
68
68
|
event = Slack::RealTime::Event.new(
|
@@ -75,7 +75,7 @@ RSpec.describe Slack::RealTime::Client, vcr: { cassette_name: 'web/rtm_start' }
|
|
75
75
|
)
|
76
76
|
client.send(:dispatch, event)
|
77
77
|
channel = client.channels['CDEADBEEF']
|
78
|
-
expect(channel).not_to
|
78
|
+
expect(channel).not_to be_nil
|
79
79
|
expect(channel.updated).to be true
|
80
80
|
end
|
81
81
|
end
|
@@ -9,7 +9,7 @@ RSpec.describe Slack::RealTime::Client, vcr: { cassette_name: 'web/rtm_start' }
|
|
9
9
|
expect(client.groups.count).to eq 1
|
10
10
|
end
|
11
11
|
it 'group_joined' do
|
12
|
-
expect(client.groups['CDEADBEEF']).to
|
12
|
+
expect(client.groups['CDEADBEEF']).to be_nil
|
13
13
|
event = Slack::RealTime::Event.new(
|
14
14
|
'type' => 'group_joined',
|
15
15
|
'channel' => {
|
@@ -19,7 +19,7 @@ RSpec.describe Slack::RealTime::Client, vcr: { cassette_name: 'web/rtm_start' }
|
|
19
19
|
)
|
20
20
|
client.send(:dispatch, event)
|
21
21
|
group = client.groups['CDEADBEEF']
|
22
|
-
expect(group).not_to
|
22
|
+
expect(group).not_to be_nil
|
23
23
|
expect(group.name).to eq 'beef'
|
24
24
|
end
|
25
25
|
it 'group_left' do
|
@@ -6,10 +6,10 @@ RSpec.describe Slack::RealTime::Client, vcr: { cassette_name: 'web/rtm_start' }
|
|
6
6
|
|
7
7
|
context 'im' do
|
8
8
|
it 'sets im data' do
|
9
|
-
expect(client.ims.count).to eq
|
9
|
+
expect(client.ims.count).to eq 10
|
10
10
|
end
|
11
11
|
it 'im_created' do
|
12
|
-
expect(client.ims['CDEADBEEF']).to
|
12
|
+
expect(client.ims['CDEADBEEF']).to be_nil
|
13
13
|
event = Slack::RealTime::Event.new(
|
14
14
|
'type' => 'im_created',
|
15
15
|
'channel' => {
|
@@ -19,27 +19,27 @@ RSpec.describe Slack::RealTime::Client, vcr: { cassette_name: 'web/rtm_start' }
|
|
19
19
|
)
|
20
20
|
client.send(:dispatch, event)
|
21
21
|
im = client.ims['CDEADBEEF']
|
22
|
-
expect(im).not_to
|
22
|
+
expect(im).not_to be_nil
|
23
23
|
expect(im.name).to eq 'beef'
|
24
24
|
end
|
25
25
|
it 'im_open' do
|
26
|
-
im = client.ims['
|
26
|
+
im = client.ims['D0J1H6QTV']
|
27
27
|
expect(im).not_to be_nil
|
28
28
|
im.is_open = false
|
29
29
|
event = Slack::RealTime::Event.new(
|
30
30
|
'type' => 'im_open',
|
31
|
-
'channel' => '
|
31
|
+
'channel' => 'D0J1H6QTV'
|
32
32
|
)
|
33
33
|
client.send(:dispatch, event)
|
34
34
|
expect(im.is_open).to be true
|
35
35
|
end
|
36
36
|
it 'im_close' do
|
37
|
-
im = client.ims['
|
37
|
+
im = client.ims['D0J1H6QTV']
|
38
38
|
expect(im).not_to be_nil
|
39
39
|
expect(im.is_open).to be true
|
40
40
|
event = Slack::RealTime::Event.new(
|
41
41
|
'type' => 'im_close',
|
42
|
-
'channel' => '
|
42
|
+
'channel' => 'D0J1H6QTV'
|
43
43
|
)
|
44
44
|
client.send(:dispatch, event)
|
45
45
|
expect(im.is_open).to be false
|
@@ -6,8 +6,8 @@ RSpec.describe Slack::RealTime::Client, vcr: { cassette_name: 'web/rtm_start' }
|
|
6
6
|
|
7
7
|
context 'user' do
|
8
8
|
it 'combines user and self data on rtm.start' do
|
9
|
-
expect(client.users['
|
10
|
-
expect(client.users['
|
9
|
+
expect(client.users['U0J1GAHN1'].name).to eq 'travis-ci'
|
10
|
+
expect(client.users['U0J1GAHN1']['prefs']['push_sound']).to eq 'b2.mp3'
|
11
11
|
end
|
12
12
|
it 'user_change' do
|
13
13
|
expect(client.users['U07KECJ77'].name).to eq 'aws'
|
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
#
|
5
5
|
# to re-record a rtm_connect fixture run with
|
6
|
-
# SLACK_API_TOKEN=... CONCURRENCY=
|
6
|
+
# SLACK_API_TOKEN=... CONCURRENCY=async-websocket rspec spec/slack/real_time/rtm_connect_spec.rb
|
7
7
|
# edit rtm_connect.yml and remove the token, fix wss:// path (run specs, fix failures)
|
8
8
|
#
|
9
9
|
|
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
#
|
5
5
|
# to re-record a rtm_start fixture run with
|
6
|
-
# SLACK_API_TOKEN=... CONCURRENCY=
|
6
|
+
# SLACK_API_TOKEN=... CONCURRENCY=async-websocket rspec spec/slack/real_time/rtm_start_spec.rb
|
7
7
|
# edit rtm_start.yml and remove the token, fix wss:// path (run specs, fix failures)
|
8
8
|
#
|
9
9
|
|
@@ -4,9 +4,9 @@ require 'spec_helper'
|
|
4
4
|
RSpec.describe Slack::RealTime::Store do
|
5
5
|
it 'can be initialized with an empty hash' do
|
6
6
|
store = described_class.new(Hashie::Mash.new)
|
7
|
-
expect(store.self).to
|
7
|
+
expect(store.self).to be_nil
|
8
8
|
expect(store.groups.count).to eq 0
|
9
|
-
expect(store.team).to
|
9
|
+
expect(store.team).to be_nil
|
10
10
|
expect(store.teams.count).to eq 0
|
11
11
|
end
|
12
12
|
end
|
data/spec/slack/slack_spec.rb
CHANGED
@@ -22,7 +22,7 @@ describe Slack do
|
|
22
22
|
context 'globals' do
|
23
23
|
let(:command) do
|
24
24
|
"\"#{slack}\" --vcr-cassette-name=web/auth_test_success " \
|
25
|
-
|
25
|
+
'--slack-api-token=token -d auth test 2>&1'
|
26
26
|
end
|
27
27
|
|
28
28
|
it 'enables request and response logging with -d' do
|
@@ -44,7 +44,7 @@ describe Slack do
|
|
44
44
|
context 'bad auth' do
|
45
45
|
let(:command) do
|
46
46
|
"\"#{slack}\" --vcr-cassette-name=web/auth_test_error " \
|
47
|
-
|
47
|
+
'--slack-api-token=token auth test 2>&1'
|
48
48
|
end
|
49
49
|
|
50
50
|
it 'fails with an exception' do
|
@@ -56,12 +56,14 @@ describe Slack do
|
|
56
56
|
context 'good auth' do
|
57
57
|
let(:command) do
|
58
58
|
"\"#{slack}\" --vcr-cassette-name=web/auth_test_success " \
|
59
|
-
|
59
|
+
'--slack-api-token=token auth test 2>&1'
|
60
60
|
end
|
61
61
|
|
62
62
|
it 'succeeds' do
|
63
63
|
json = Slack::Messages::Message.new(JSON[`#{command}`])
|
64
64
|
expect(json).to eq(
|
65
|
+
'bot_id' => 'B0J1L75DY',
|
66
|
+
'is_enterprise_install' => false,
|
65
67
|
'ok' => true,
|
66
68
|
'url' => 'https://rubybot.slack.com/',
|
67
69
|
'team' => 'team_name',
|
@@ -77,13 +79,13 @@ describe Slack do
|
|
77
79
|
describe '#users' do
|
78
80
|
let(:command) do
|
79
81
|
"\"#{slack}\" --vcr-cassette-name=web/users_list " \
|
80
|
-
|
82
|
+
'--slack-api-token=token users list --presence=true 2>&1'
|
81
83
|
end
|
82
84
|
|
83
85
|
it 'list' do
|
84
86
|
json = Slack::Messages::Message.new(JSON[`#{command}`])
|
85
87
|
expect(json.ok).to be true
|
86
|
-
expect(json.members.size).to eq
|
88
|
+
expect(json.members.size).to eq 35
|
87
89
|
expect(json.members.first['presence']).to eq 'away'
|
88
90
|
end
|
89
91
|
end
|
data/spec/slack/version_spec.rb
CHANGED
@@ -5,4 +5,9 @@ require 'spec_helper'
|
|
5
5
|
|
6
6
|
RSpec.describe Slack::Web::Api::Endpoints::AdminAppsRequests do
|
7
7
|
let(:client) { Slack::Web::Client.new }
|
8
|
+
context 'admin.apps.requests_cancel' do
|
9
|
+
it 'requires request_id' do
|
10
|
+
expect { client.admin_apps_requests_cancel }.to raise_error ArgumentError, /Required arguments :request_id missing/
|
11
|
+
end
|
12
|
+
end
|
8
13
|
end
|
@@ -10,4 +10,9 @@ RSpec.describe Slack::Web::Api::Endpoints::AdminApps do
|
|
10
10
|
expect { client.admin_apps_clearResolution }.to raise_error ArgumentError, /Required arguments :app_id missing/
|
11
11
|
end
|
12
12
|
end
|
13
|
+
context 'admin.apps_uninstall' do
|
14
|
+
it 'requires app_id' do
|
15
|
+
expect { client.admin_apps_uninstall }.to raise_error ArgumentError, /Required arguments :app_id missing/
|
16
|
+
end
|
17
|
+
end
|
13
18
|
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
3
|
+
|
4
|
+
require 'spec_helper'
|
5
|
+
|
6
|
+
RSpec.describe Slack::Web::Api::Endpoints::AdminAuthPolicy do
|
7
|
+
let(:client) { Slack::Web::Client.new }
|
8
|
+
context 'admin.auth.policy_assignEntities' do
|
9
|
+
it 'requires entity_ids' do
|
10
|
+
expect { client.admin_auth_policy_assignEntities(entity_type: %q[], policy_name: %q[]) }.to raise_error ArgumentError, /Required arguments :entity_ids missing/
|
11
|
+
end
|
12
|
+
it 'requires entity_type' do
|
13
|
+
expect { client.admin_auth_policy_assignEntities(entity_ids: %q[], policy_name: %q[]) }.to raise_error ArgumentError, /Required arguments :entity_type missing/
|
14
|
+
end
|
15
|
+
it 'requires policy_name' do
|
16
|
+
expect { client.admin_auth_policy_assignEntities(entity_ids: %q[], entity_type: %q[]) }.to raise_error ArgumentError, /Required arguments :policy_name missing/
|
17
|
+
end
|
18
|
+
end
|
19
|
+
context 'admin.auth.policy_getEntities' do
|
20
|
+
it 'requires policy_name' do
|
21
|
+
expect { client.admin_auth_policy_getEntities }.to raise_error ArgumentError, /Required arguments :policy_name missing/
|
22
|
+
end
|
23
|
+
end
|
24
|
+
context 'admin.auth.policy_removeEntities' do
|
25
|
+
it 'requires entity_ids' do
|
26
|
+
expect { client.admin_auth_policy_removeEntities(entity_type: %q[], policy_name: %q[]) }.to raise_error ArgumentError, /Required arguments :entity_ids missing/
|
27
|
+
end
|
28
|
+
it 'requires entity_type' do
|
29
|
+
expect { client.admin_auth_policy_removeEntities(entity_ids: %q[], policy_name: %q[]) }.to raise_error ArgumentError, /Required arguments :entity_type missing/
|
30
|
+
end
|
31
|
+
it 'requires policy_name' do
|
32
|
+
expect { client.admin_auth_policy_removeEntities(entity_ids: %q[], entity_type: %q[]) }.to raise_error ArgumentError, /Required arguments :policy_name missing/
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -17,10 +17,10 @@ RSpec.describe Slack::Web::Api::Endpoints::AdminConversations do
|
|
17
17
|
end
|
18
18
|
context 'admin.conversations_create' do
|
19
19
|
it 'requires is_private' do
|
20
|
-
expect { client.admin_conversations_create(name: %q[
|
20
|
+
expect { client.admin_conversations_create(name: %q[]) }.to raise_error ArgumentError, /Required arguments :is_private missing/
|
21
21
|
end
|
22
22
|
it 'requires name' do
|
23
|
-
expect { client.admin_conversations_create(is_private: %q[
|
23
|
+
expect { client.admin_conversations_create(is_private: %q[]) }.to raise_error ArgumentError, /Required arguments :name missing/
|
24
24
|
end
|
25
25
|
end
|
26
26
|
context 'admin.conversations_delete' do
|
@@ -50,10 +50,10 @@ RSpec.describe Slack::Web::Api::Endpoints::AdminConversations do
|
|
50
50
|
end
|
51
51
|
context 'admin.conversations_invite' do
|
52
52
|
it 'requires channel_id' do
|
53
|
-
expect { client.admin_conversations_invite(user_ids: %q[
|
53
|
+
expect { client.admin_conversations_invite(user_ids: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
54
54
|
end
|
55
55
|
it 'requires user_ids' do
|
56
|
-
expect { client.admin_conversations_invite(channel_id: %q[
|
56
|
+
expect { client.admin_conversations_invite(channel_id: %q[]) }.to raise_error ArgumentError, /Required arguments :user_ids missing/
|
57
57
|
end
|
58
58
|
end
|
59
59
|
context 'admin.conversations_removeCustomRetention' do
|
@@ -66,23 +66,23 @@ RSpec.describe Slack::Web::Api::Endpoints::AdminConversations do
|
|
66
66
|
expect { client.admin_conversations_rename(name: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
67
67
|
end
|
68
68
|
it 'requires name' do
|
69
|
-
expect { client.admin_conversations_rename(channel_id: %q[
|
69
|
+
expect { client.admin_conversations_rename(channel_id: %q[]) }.to raise_error ArgumentError, /Required arguments :name missing/
|
70
70
|
end
|
71
71
|
end
|
72
72
|
context 'admin.conversations_setConversationPrefs' do
|
73
73
|
it 'requires channel_id' do
|
74
|
-
expect { client.admin_conversations_setConversationPrefs(prefs: %q[
|
74
|
+
expect { client.admin_conversations_setConversationPrefs(prefs: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
75
75
|
end
|
76
76
|
it 'requires prefs' do
|
77
|
-
expect { client.admin_conversations_setConversationPrefs(channel_id: %q[
|
77
|
+
expect { client.admin_conversations_setConversationPrefs(channel_id: %q[]) }.to raise_error ArgumentError, /Required arguments :prefs missing/
|
78
78
|
end
|
79
79
|
end
|
80
80
|
context 'admin.conversations_setCustomRetention' do
|
81
81
|
it 'requires channel_id' do
|
82
|
-
expect { client.admin_conversations_setCustomRetention(duration_days: %q[
|
82
|
+
expect { client.admin_conversations_setCustomRetention(duration_days: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
83
83
|
end
|
84
84
|
it 'requires duration_days' do
|
85
|
-
expect { client.admin_conversations_setCustomRetention(channel_id: %q[
|
85
|
+
expect { client.admin_conversations_setCustomRetention(channel_id: %q[]) }.to raise_error ArgumentError, /Required arguments :duration_days missing/
|
86
86
|
end
|
87
87
|
end
|
88
88
|
context 'admin.conversations_setTeams' do
|
@@ -39,7 +39,7 @@ RSpec.describe Slack::Web::Api::Endpoints::AdminTeamsSettings do
|
|
39
39
|
expect { client.admin_teams_settings_setIcon(team_id: %q[]) }.to raise_error ArgumentError, /Required arguments :image_url missing/
|
40
40
|
end
|
41
41
|
it 'requires team_id' do
|
42
|
-
expect { client.admin_teams_settings_setIcon(image_url: %q[
|
42
|
+
expect { client.admin_teams_settings_setIcon(image_url: %q[]) }.to raise_error ArgumentError, /Required arguments :team_id missing/
|
43
43
|
end
|
44
44
|
end
|
45
45
|
context 'admin.teams.settings_setName' do
|