slack-ruby-client 0.15.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +6 -1
- data/.rubocop_todo.yml +75 -43
- data/.travis.yml +2 -4
- data/CHANGELOG.md +32 -0
- data/CONTRIBUTING.md +6 -13
- data/LICENSE.md +1 -1
- data/README.md +19 -36
- data/RELEASING.md +1 -1
- data/UPGRADING.md +56 -2
- data/bin/commands/admin_analytics.rb +16 -0
- data/bin/commands/admin_apps.rb +26 -2
- data/bin/commands/admin_apps_requests.rb +1 -0
- data/bin/commands/admin_auth_policy.rb +39 -0
- data/bin/commands/admin_barriers.rb +47 -0
- data/bin/commands/admin_conversations.rb +154 -2
- data/bin/commands/admin_conversations_ekm.rb +17 -0
- data/bin/commands/admin_conversations_restrictAccess.rb +3 -3
- data/bin/commands/admin_conversations_whitelist.rb +1 -1
- data/bin/commands/admin_emoji.rb +1 -1
- data/bin/commands/admin_teams.rb +1 -1
- data/bin/commands/admin_usergroups.rb +2 -2
- data/bin/commands/admin_users.rb +3 -2
- data/bin/commands/admin_users_session.rb +62 -0
- data/bin/commands/api.rb +0 -1
- data/bin/commands/apps_connections.rb +13 -0
- data/bin/commands/apps_event_authorizations.rb +16 -0
- data/bin/commands/apps_manifest.rb +51 -0
- data/bin/commands/auth_teams.rb +16 -0
- data/bin/commands/bots.rb +1 -0
- data/bin/commands/channels.rb +1 -155
- data/bin/commands/chat.rb +12 -7
- data/bin/commands/chat_scheduledMessages.rb +1 -0
- data/bin/commands/conversations.rb +71 -2
- data/bin/commands/dnd.rb +2 -0
- data/bin/commands/files.rb +6 -4
- data/bin/commands/files_remote.rb +2 -2
- data/bin/commands/groups.rb +1 -162
- data/bin/commands/im.rb +1 -63
- data/bin/commands/migration.rb +1 -0
- data/bin/commands/mpim.rb +1 -61
- 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 -4
- data/bin/commands/reactions.rb +1 -0
- data/bin/commands/reminders.rb +6 -0
- data/bin/commands/rtm.rb +2 -2
- data/bin/commands/search.rb +4 -0
- data/bin/commands/stars.rb +7 -6
- data/bin/commands/team.rb +3 -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 +5 -0
- data/bin/commands/usergroups_users.rb +2 -0
- data/bin/commands/users.rb +4 -2
- data/bin/commands/users_profile.rb +5 -5
- data/bin/commands/views.rb +2 -2
- data/bin/commands/workflows.rb +38 -0
- data/bin/commands.rb +13 -9
- data/lib/slack/config.rb +1 -2
- data/lib/slack/events/request.rb +10 -4
- data/lib/slack/real_time/client.rb +6 -6
- data/lib/slack/real_time/concurrency/async.rb +6 -8
- data/lib/slack/real_time/concurrency.rb +0 -2
- data/lib/slack/real_time/config.rb +5 -14
- 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 +28 -0
- data/lib/slack/web/api/endpoints/admin_apps.rb +42 -6
- data/lib/slack/web/api/endpoints/admin_apps_approved.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_apps_requests.rb +4 -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 +82 -0
- data/lib/slack/web/api/endpoints/admin_conversations.rb +233 -3
- data/lib/slack/web/api/endpoints/admin_conversations_ekm.rb +35 -0
- data/lib/slack/web/api/endpoints/admin_conversations_restrictAccess.rb +3 -3
- data/lib/slack/web/api/endpoints/admin_conversations_whitelist.rb +3 -3
- data/lib/slack/web/api/endpoints/admin_emoji.rb +10 -10
- 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 +11 -11
- data/lib/slack/web/api/endpoints/admin_users.rb +23 -23
- data/lib/slack/web/api/endpoints/admin_users_session.rb +97 -3
- data/lib/slack/web/api/endpoints/api.rb +1 -3
- data/lib/slack/web/api/endpoints/apps.rb +2 -2
- data/lib/slack/web/api/endpoints/apps_connections.rb +21 -0
- data/lib/slack/web/api/endpoints/apps_event_authorizations.rb +34 -0
- data/lib/slack/web/api/endpoints/apps_manifest.rb +75 -0
- data/lib/slack/web/api/endpoints/auth.rb +1 -1
- data/lib/slack/web/api/endpoints/auth_teams.rb +33 -0
- data/lib/slack/web/api/endpoints/bots.rb +3 -1
- 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 -259
- data/lib/slack/web/api/endpoints/chat.rb +65 -55
- data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +4 -2
- data/lib/slack/web/api/endpoints/conversations.rb +134 -24
- 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 +19 -15
- data/lib/slack/web/api/endpoints/files_comments.rb +1 -1
- data/lib/slack/web/api/endpoints/files_remote.rb +22 -22
- data/lib/slack/web/api/endpoints/groups.rb +0 -269
- data/lib/slack/web/api/endpoints/im.rb +0 -107
- data/lib/slack/web/api/endpoints/migration.rb +4 -2
- 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 -9
- data/lib/slack/web/api/endpoints/reactions.rb +13 -11
- 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 +27 -13
- data/lib/slack/web/api/endpoints/stars.rb +11 -9
- data/lib/slack/web/api/endpoints/team.rb +11 -5
- 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 +26 -16
- data/lib/slack/web/api/endpoints/usergroups_users.rb +9 -5
- data/lib/slack/web/api/endpoints/users.rb +20 -18
- data/lib/slack/web/api/endpoints/users_profile.rb +7 -7
- data/lib/slack/web/api/endpoints/views.rb +13 -13
- data/lib/slack/web/api/endpoints/workflows.rb +61 -0
- data/lib/slack/web/api/endpoints.rb +26 -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 +394 -10
- data/lib/slack/web/api/mixins/conversations.id.rb +1 -3
- data/lib/slack/web/api/mixins/ids.id.rb +2 -2
- data/lib/slack/web/api/mixins/users.id.rb +1 -3
- data/lib/slack/web/api/mixins.rb +0 -2
- data/lib/slack/web/api/patches/chat.1.patch +6 -8
- data/lib/slack/web/api/templates/endpoints.erb +1 -2
- data/lib/slack/web/api/templates/method_spec.erb +1 -1
- data/lib/slack/web/config.rb +2 -0
- data/lib/slack/web/faraday/connection.rb +2 -2
- data/lib/slack/web/faraday/request.rb +2 -1
- data/lib/slack/web/faraday/response/raise_error.rb +12 -1
- data/lib/slack/web/faraday/response/wrap_error.rb +24 -0
- data/lib/slack/web/pagination/cursor.rb +1 -5
- data/lib/slack-ruby-client.rb +2 -0
- data/lib/tasks/web.rake +11 -3
- data/slack-ruby-client.gemspec +2 -3
- 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 +84 -0
- data/spec/fixtures/slack/web/conversations_setTopic_one_page.yml +172 -0
- data/spec/fixtures/slack/web/conversations_setTopic_paginated.yml +253 -0
- 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/slack/events/request_spec.rb +13 -8
- data/spec/slack/real_time/client_spec.rb +35 -22
- 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 +1 -1
- data/spec/slack/real_time/event_handlers/im_spec.rb +5 -5
- 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/slack_spec.rb +3 -1
- data/spec/slack/web/api/endpoints/admin_analytics_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/admin_apps_spec.rb +10 -0
- data/spec/slack/web/api/endpoints/admin_auth_policy_spec.rb +35 -0
- data/spec/slack/web/api/endpoints/admin_barriers_spec.rb +38 -0
- data/spec/slack/web/api/endpoints/{apps_permissions_scopes_spec.rb → admin_conversations_ekm_spec.rb} +1 -1
- data/spec/slack/web/api/endpoints/admin_conversations_restrictAccess_spec.rb +5 -5
- data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +85 -0
- data/spec/slack/web/api/endpoints/admin_emoji_spec.rb +6 -6
- data/spec/slack/web/api/endpoints/admin_teams_settings_spec.rb +10 -10
- data/spec/slack/web/api/endpoints/admin_teams_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +6 -6
- data/spec/slack/web/api/endpoints/admin_users_session_spec.rb +28 -0
- data/spec/slack/web/api/endpoints/admin_users_spec.rb +15 -23
- data/spec/slack/web/api/endpoints/{apps_permissions_resources_spec.rb → apps_connections_spec.rb} +1 -1
- data/spec/slack/web/api/endpoints/apps_event_authorizations_spec.rb +13 -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/auth_teams_spec.rb +8 -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/conversations_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/custom_specs/users_spec.rb +2 -2
- 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/files_spec.rb +4 -4
- 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/openid_connect_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/pins_spec.rb +1 -4
- 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/team_billing_spec.rb +8 -0
- 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/endpoints/workflows_spec.rb +26 -0
- 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 +21 -0
- data/spec/slack/web/api/mixins/conversations_spec.rb +11 -9
- data/spec/slack/web/api/mixins/users_spec.rb +1 -1
- data/spec/slack/web/api/pagination/cursor_spec.rb +1 -3
- data/spec/slack/web/client_spec.rb +112 -16
- data/spec/slack/web/faraday/request_spec.rb +80 -0
- data/spec/slack/web/faraday/response/raise_error_spec.rb +8 -6
- data/spec/spec_helper.rb +1 -1
- data/spec/support/real_time/connected_client.rb +1 -7
- data/spec/support/vcr.rb +36 -1
- metadata +58 -155
- data/examples/hi_real_time/Gemfile +0 -6
- data/examples/hi_real_time/hi.gif +0 -0
- data/examples/hi_real_time/hi.rb +0 -41
- data/examples/hi_real_time_async_celluloid/Gemfile +0 -7
- data/examples/hi_real_time_async_celluloid/Procfile +0 -2
- data/examples/hi_real_time_async_celluloid/hi.rb +0 -39
- data/examples/hi_real_time_async_eventmachine/Gemfile +0 -7
- data/examples/hi_real_time_async_eventmachine/Procfile +0 -2
- data/examples/hi_real_time_async_eventmachine/hi.rb +0 -39
- data/lib/slack/real_time/concurrency/celluloid.rb +0 -142
- data/lib/slack/real_time/concurrency/eventmachine.rb +0 -85
- data/lib/slack/web/api/mixins/channels.id.json +0 -20
- data/lib/slack/web/api/mixins/channels.id.rb +0 -27
- data/lib/slack/web/api/mixins/groups.id.json +0 -20
- data/lib/slack/web/api/mixins/groups.id.rb +0 -27
- 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/real_time/concurrency/celluloid_spec.rb +0 -116
- data/spec/slack/real_time/concurrency/eventmachine_spec.rb +0 -57
- 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 -101
- 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/errors/service_unavailable_spec.rb +0 -17
- data/spec/slack/web/api/mixins/channels_spec.rb +0 -43
- data/spec/slack/web/api/mixins/groups_spec.rb +0 -43
@@ -1,14 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
require 'spec_helper'
|
3
3
|
|
4
|
-
RSpec.describe Slack::RealTime::Client do
|
4
|
+
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 # rubocop:disable Metrics/BlockLength
|
|
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,7 +66,7 @@ RSpec.describe Slack::RealTime::Client do # rubocop:disable Metrics/BlockLength
|
|
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) }
|
@@ -96,22 +92,22 @@ RSpec.describe Slack::RealTime::Client do # rubocop:disable Metrics/BlockLength
|
|
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
|
@@ -166,6 +162,23 @@ RSpec.describe Slack::RealTime::Client do # rubocop:disable Metrics/BlockLength
|
|
166
162
|
expect(client.store.team.name).to eq 'New Team Name Inc.'
|
167
163
|
end
|
168
164
|
end
|
165
|
+
|
166
|
+
describe '#run_handlers' do
|
167
|
+
describe 'empty events' do
|
168
|
+
before do
|
169
|
+
@e = client.store.class.events
|
170
|
+
client.store.class.events = nil
|
171
|
+
end
|
172
|
+
|
173
|
+
after do
|
174
|
+
client.store.class.events = @e
|
175
|
+
end
|
176
|
+
|
177
|
+
it 'returns false when event is nil' do
|
178
|
+
expect(client.send(:run_handlers, 'example', {})).to be nil
|
179
|
+
end
|
180
|
+
end
|
181
|
+
end
|
169
182
|
end
|
170
183
|
|
171
184
|
describe '#start_async' do
|
@@ -235,7 +248,7 @@ RSpec.describe Slack::RealTime::Client do # rubocop:disable Metrics/BlockLength
|
|
235
248
|
|
236
249
|
context 'client with starter store', vcr: { cassette_name: 'web/rtm_connect' } do
|
237
250
|
let(:client) { described_class.new(store_class: Slack::RealTime::Stores::Starter) }
|
238
|
-
let(:url) { 'wss://
|
251
|
+
let(:url) { 'wss://cerberus-xxxx.lb.slack-msgs.com/websocket/uid' }
|
239
252
|
|
240
253
|
describe '#start!' do
|
241
254
|
let(:socket) { double(Slack::RealTime::Socket, connected?: true) }
|
@@ -257,7 +270,7 @@ RSpec.describe Slack::RealTime::Client do # rubocop:disable Metrics/BlockLength
|
|
257
270
|
expect(client.team.domain).to eq 'dblockdotorg'
|
258
271
|
end
|
259
272
|
it 'sets self' do
|
260
|
-
expect(client.self.id).to eq '
|
273
|
+
expect(client.self.id).to eq 'U0J1GAHN1'
|
261
274
|
end
|
262
275
|
it 'no users' do
|
263
276
|
expect(client.users).to be_nil
|
@@ -362,7 +375,7 @@ RSpec.describe Slack::RealTime::Client do # rubocop:disable Metrics/BlockLength
|
|
362
375
|
it 'sets default store_class' do
|
363
376
|
expect(client.send(:store_class)).to eq Slack::RealTime::Store
|
364
377
|
end
|
365
|
-
(Slack::RealTime::Config::ATTRIBUTES - %i[logger store_class]).each do |key|
|
378
|
+
(Slack::RealTime::Config::ATTRIBUTES - %i[logger store_class token]).each do |key|
|
366
379
|
it "sets #{key}" do
|
367
380
|
expect(client.send(key)).to eq Slack::RealTime::Config.send(key)
|
368
381
|
end
|
@@ -414,7 +427,7 @@ RSpec.describe Slack::RealTime::Client do # rubocop:disable Metrics/BlockLength
|
|
414
427
|
described_class.config.reset
|
415
428
|
end
|
416
429
|
|
417
|
-
let(:url) { 'wss://
|
430
|
+
let(:url) { 'wss://cerberus-xxxx.lb.slack-msgs.com/websocket/uid' }
|
418
431
|
let(:client) { described_class.new }
|
419
432
|
|
420
433
|
context 'ping' do
|
@@ -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']
|
@@ -6,7 +6,7 @@ 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
12
|
expect(client.ims['CDEADBEEF']).to be nil
|
@@ -23,23 +23,23 @@ RSpec.describe Slack::RealTime::Client, vcr: { cassette_name: 'web/rtm_start' }
|
|
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
|
|
data/spec/slack/slack_spec.rb
CHANGED
@@ -62,6 +62,8 @@ describe Slack do
|
|
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',
|
@@ -83,7 +85,7 @@ describe Slack do
|
|
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
|
@@ -0,0 +1,13 @@
|
|
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::AdminAnalytics do
|
7
|
+
let(:client) { Slack::Web::Client.new }
|
8
|
+
context 'admin.analytics_getFile' do
|
9
|
+
it 'requires type' do
|
10
|
+
expect { client.admin_analytics_getFile }.to raise_error ArgumentError, /Required arguments :type missing/
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -5,4 +5,14 @@ require 'spec_helper'
|
|
5
5
|
|
6
6
|
RSpec.describe Slack::Web::Api::Endpoints::AdminApps do
|
7
7
|
let(:client) { Slack::Web::Client.new }
|
8
|
+
context 'admin.apps_clearResolution' do
|
9
|
+
it 'requires app_id' do
|
10
|
+
expect { client.admin_apps_clearResolution }.to raise_error ArgumentError, /Required arguments :app_id missing/
|
11
|
+
end
|
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
|
8
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
|
@@ -0,0 +1,38 @@
|
|
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::AdminBarriers do
|
7
|
+
let(:client) { Slack::Web::Client.new }
|
8
|
+
context 'admin.barriers_create' do
|
9
|
+
it 'requires barriered_from_usergroup_ids' do
|
10
|
+
expect { client.admin_barriers_create(primary_usergroup_id: %q[], restricted_subjects: %q[]) }.to raise_error ArgumentError, /Required arguments :barriered_from_usergroup_ids missing/
|
11
|
+
end
|
12
|
+
it 'requires primary_usergroup_id' do
|
13
|
+
expect { client.admin_barriers_create(barriered_from_usergroup_ids: %q[], restricted_subjects: %q[]) }.to raise_error ArgumentError, /Required arguments :primary_usergroup_id missing/
|
14
|
+
end
|
15
|
+
it 'requires restricted_subjects' do
|
16
|
+
expect { client.admin_barriers_create(barriered_from_usergroup_ids: %q[], primary_usergroup_id: %q[]) }.to raise_error ArgumentError, /Required arguments :restricted_subjects missing/
|
17
|
+
end
|
18
|
+
end
|
19
|
+
context 'admin.barriers_delete' do
|
20
|
+
it 'requires barrier_id' do
|
21
|
+
expect { client.admin_barriers_delete }.to raise_error ArgumentError, /Required arguments :barrier_id missing/
|
22
|
+
end
|
23
|
+
end
|
24
|
+
context 'admin.barriers_update' do
|
25
|
+
it 'requires barrier_id' do
|
26
|
+
expect { client.admin_barriers_update(barriered_from_usergroup_ids: %q[], primary_usergroup_id: %q[], restricted_subjects: %q[]) }.to raise_error ArgumentError, /Required arguments :barrier_id missing/
|
27
|
+
end
|
28
|
+
it 'requires barriered_from_usergroup_ids' do
|
29
|
+
expect { client.admin_barriers_update(barrier_id: %q[], primary_usergroup_id: %q[], restricted_subjects: %q[]) }.to raise_error ArgumentError, /Required arguments :barriered_from_usergroup_ids missing/
|
30
|
+
end
|
31
|
+
it 'requires primary_usergroup_id' do
|
32
|
+
expect { client.admin_barriers_update(barrier_id: %q[], barriered_from_usergroup_ids: %q[], restricted_subjects: %q[]) }.to raise_error ArgumentError, /Required arguments :primary_usergroup_id missing/
|
33
|
+
end
|
34
|
+
it 'requires restricted_subjects' do
|
35
|
+
expect { client.admin_barriers_update(barrier_id: %q[], barriered_from_usergroup_ids: %q[], primary_usergroup_id: %q[]) }.to raise_error ArgumentError, /Required arguments :restricted_subjects missing/
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -7,10 +7,10 @@ RSpec.describe Slack::Web::Api::Endpoints::AdminConversationsRestrictaccess do
|
|
7
7
|
let(:client) { Slack::Web::Client.new }
|
8
8
|
context 'admin.conversations.restrictAccess_addGroup' do
|
9
9
|
it 'requires channel_id' do
|
10
|
-
expect { client.admin_conversations_restrictAccess_addGroup(group_id:
|
10
|
+
expect { client.admin_conversations_restrictAccess_addGroup(group_id: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
11
11
|
end
|
12
12
|
it 'requires group_id' do
|
13
|
-
expect { client.admin_conversations_restrictAccess_addGroup(channel_id:
|
13
|
+
expect { client.admin_conversations_restrictAccess_addGroup(channel_id: %q[]) }.to raise_error ArgumentError, /Required arguments :group_id missing/
|
14
14
|
end
|
15
15
|
end
|
16
16
|
context 'admin.conversations.restrictAccess_listGroups' do
|
@@ -20,13 +20,13 @@ RSpec.describe Slack::Web::Api::Endpoints::AdminConversationsRestrictaccess do
|
|
20
20
|
end
|
21
21
|
context 'admin.conversations.restrictAccess_removeGroup' do
|
22
22
|
it 'requires channel_id' do
|
23
|
-
expect { client.admin_conversations_restrictAccess_removeGroup(group_id:
|
23
|
+
expect { client.admin_conversations_restrictAccess_removeGroup(group_id: %q[], team_id: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
24
24
|
end
|
25
25
|
it 'requires group_id' do
|
26
|
-
expect { client.admin_conversations_restrictAccess_removeGroup(channel_id:
|
26
|
+
expect { client.admin_conversations_restrictAccess_removeGroup(channel_id: %q[], team_id: %q[]) }.to raise_error ArgumentError, /Required arguments :group_id missing/
|
27
27
|
end
|
28
28
|
it 'requires team_id' do
|
29
|
-
expect { client.admin_conversations_restrictAccess_removeGroup(channel_id:
|
29
|
+
expect { client.admin_conversations_restrictAccess_removeGroup(channel_id: %q[], group_id: %q[]) }.to raise_error ArgumentError, /Required arguments :team_id missing/
|
30
30
|
end
|
31
31
|
end
|
32
32
|
end
|
@@ -5,9 +5,94 @@ require 'spec_helper'
|
|
5
5
|
|
6
6
|
RSpec.describe Slack::Web::Api::Endpoints::AdminConversations do
|
7
7
|
let(:client) { Slack::Web::Client.new }
|
8
|
+
context 'admin.conversations_archive' do
|
9
|
+
it 'requires channel_id' do
|
10
|
+
expect { client.admin_conversations_archive }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
11
|
+
end
|
12
|
+
end
|
13
|
+
context 'admin.conversations_convertToPrivate' do
|
14
|
+
it 'requires channel_id' do
|
15
|
+
expect { client.admin_conversations_convertToPrivate }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
16
|
+
end
|
17
|
+
end
|
18
|
+
context 'admin.conversations_create' do
|
19
|
+
it 'requires is_private' do
|
20
|
+
expect { client.admin_conversations_create(name: %q[]) }.to raise_error ArgumentError, /Required arguments :is_private missing/
|
21
|
+
end
|
22
|
+
it 'requires name' do
|
23
|
+
expect { client.admin_conversations_create(is_private: %q[]) }.to raise_error ArgumentError, /Required arguments :name missing/
|
24
|
+
end
|
25
|
+
end
|
26
|
+
context 'admin.conversations_delete' do
|
27
|
+
it 'requires channel_id' do
|
28
|
+
expect { client.admin_conversations_delete }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
29
|
+
end
|
30
|
+
end
|
31
|
+
context 'admin.conversations_disconnectShared' do
|
32
|
+
it 'requires channel_id' do
|
33
|
+
expect { client.admin_conversations_disconnectShared }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
34
|
+
end
|
35
|
+
end
|
36
|
+
context 'admin.conversations_getConversationPrefs' do
|
37
|
+
it 'requires channel_id' do
|
38
|
+
expect { client.admin_conversations_getConversationPrefs }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
39
|
+
end
|
40
|
+
end
|
41
|
+
context 'admin.conversations_getCustomRetention' do
|
42
|
+
it 'requires channel_id' do
|
43
|
+
expect { client.admin_conversations_getCustomRetention }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
44
|
+
end
|
45
|
+
end
|
46
|
+
context 'admin.conversations_getTeams' do
|
47
|
+
it 'requires channel_id' do
|
48
|
+
expect { client.admin_conversations_getTeams }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
49
|
+
end
|
50
|
+
end
|
51
|
+
context 'admin.conversations_invite' do
|
52
|
+
it 'requires channel_id' do
|
53
|
+
expect { client.admin_conversations_invite(user_ids: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
54
|
+
end
|
55
|
+
it 'requires user_ids' do
|
56
|
+
expect { client.admin_conversations_invite(channel_id: %q[]) }.to raise_error ArgumentError, /Required arguments :user_ids missing/
|
57
|
+
end
|
58
|
+
end
|
59
|
+
context 'admin.conversations_removeCustomRetention' do
|
60
|
+
it 'requires channel_id' do
|
61
|
+
expect { client.admin_conversations_removeCustomRetention }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
62
|
+
end
|
63
|
+
end
|
64
|
+
context 'admin.conversations_rename' do
|
65
|
+
it 'requires channel_id' do
|
66
|
+
expect { client.admin_conversations_rename(name: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
67
|
+
end
|
68
|
+
it 'requires name' do
|
69
|
+
expect { client.admin_conversations_rename(channel_id: %q[]) }.to raise_error ArgumentError, /Required arguments :name missing/
|
70
|
+
end
|
71
|
+
end
|
72
|
+
context 'admin.conversations_setConversationPrefs' do
|
73
|
+
it 'requires channel_id' do
|
74
|
+
expect { client.admin_conversations_setConversationPrefs(prefs: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
75
|
+
end
|
76
|
+
it 'requires prefs' do
|
77
|
+
expect { client.admin_conversations_setConversationPrefs(channel_id: %q[]) }.to raise_error ArgumentError, /Required arguments :prefs missing/
|
78
|
+
end
|
79
|
+
end
|
80
|
+
context 'admin.conversations_setCustomRetention' do
|
81
|
+
it 'requires channel_id' do
|
82
|
+
expect { client.admin_conversations_setCustomRetention(duration_days: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
83
|
+
end
|
84
|
+
it 'requires duration_days' do
|
85
|
+
expect { client.admin_conversations_setCustomRetention(channel_id: %q[]) }.to raise_error ArgumentError, /Required arguments :duration_days missing/
|
86
|
+
end
|
87
|
+
end
|
8
88
|
context 'admin.conversations_setTeams' do
|
9
89
|
it 'requires channel_id' do
|
10
90
|
expect { client.admin_conversations_setTeams }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
11
91
|
end
|
12
92
|
end
|
93
|
+
context 'admin.conversations_unarchive' do
|
94
|
+
it 'requires channel_id' do
|
95
|
+
expect { client.admin_conversations_unarchive }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
96
|
+
end
|
97
|
+
end
|
13
98
|
end
|
@@ -7,18 +7,18 @@ RSpec.describe Slack::Web::Api::Endpoints::AdminEmoji do
|
|
7
7
|
let(:client) { Slack::Web::Client.new }
|
8
8
|
context 'admin.emoji_add' do
|
9
9
|
it 'requires name' do
|
10
|
-
expect { client.admin_emoji_add(url:
|
10
|
+
expect { client.admin_emoji_add(url: %q[]) }.to raise_error ArgumentError, /Required arguments :name missing/
|
11
11
|
end
|
12
12
|
it 'requires url' do
|
13
|
-
expect { client.admin_emoji_add(name:
|
13
|
+
expect { client.admin_emoji_add(name: %q[]) }.to raise_error ArgumentError, /Required arguments :url missing/
|
14
14
|
end
|
15
15
|
end
|
16
16
|
context 'admin.emoji_addAlias' do
|
17
17
|
it 'requires alias_for' do
|
18
|
-
expect { client.admin_emoji_addAlias(name:
|
18
|
+
expect { client.admin_emoji_addAlias(name: %q[]) }.to raise_error ArgumentError, /Required arguments :alias_for missing/
|
19
19
|
end
|
20
20
|
it 'requires name' do
|
21
|
-
expect { client.admin_emoji_addAlias(alias_for:
|
21
|
+
expect { client.admin_emoji_addAlias(alias_for: %q[]) }.to raise_error ArgumentError, /Required arguments :name missing/
|
22
22
|
end
|
23
23
|
end
|
24
24
|
context 'admin.emoji_remove' do
|
@@ -28,10 +28,10 @@ RSpec.describe Slack::Web::Api::Endpoints::AdminEmoji do
|
|
28
28
|
end
|
29
29
|
context 'admin.emoji_rename' do
|
30
30
|
it 'requires name' do
|
31
|
-
expect { client.admin_emoji_rename(new_name:
|
31
|
+
expect { client.admin_emoji_rename(new_name: %q[]) }.to raise_error ArgumentError, /Required arguments :name missing/
|
32
32
|
end
|
33
33
|
it 'requires new_name' do
|
34
|
-
expect { client.admin_emoji_rename(name:
|
34
|
+
expect { client.admin_emoji_rename(name: %q[]) }.to raise_error ArgumentError, /Required arguments :new_name missing/
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
@@ -12,42 +12,42 @@ RSpec.describe Slack::Web::Api::Endpoints::AdminTeamsSettings do
|
|
12
12
|
end
|
13
13
|
context 'admin.teams.settings_setDefaultChannels' do
|
14
14
|
it 'requires channel_ids' do
|
15
|
-
expect { client.admin_teams_settings_setDefaultChannels(team_id:
|
15
|
+
expect { client.admin_teams_settings_setDefaultChannels(team_id: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_ids missing/
|
16
16
|
end
|
17
17
|
it 'requires team_id' do
|
18
|
-
expect { client.admin_teams_settings_setDefaultChannels(channel_ids:
|
18
|
+
expect { client.admin_teams_settings_setDefaultChannels(channel_ids: %q[]) }.to raise_error ArgumentError, /Required arguments :team_id missing/
|
19
19
|
end
|
20
20
|
end
|
21
21
|
context 'admin.teams.settings_setDescription' do
|
22
22
|
it 'requires description' do
|
23
|
-
expect { client.admin_teams_settings_setDescription(team_id:
|
23
|
+
expect { client.admin_teams_settings_setDescription(team_id: %q[]) }.to raise_error ArgumentError, /Required arguments :description missing/
|
24
24
|
end
|
25
25
|
it 'requires team_id' do
|
26
|
-
expect { client.admin_teams_settings_setDescription(description:
|
26
|
+
expect { client.admin_teams_settings_setDescription(description: %q[]) }.to raise_error ArgumentError, /Required arguments :team_id missing/
|
27
27
|
end
|
28
28
|
end
|
29
29
|
context 'admin.teams.settings_setDiscoverability' do
|
30
30
|
it 'requires discoverability' do
|
31
|
-
expect { client.admin_teams_settings_setDiscoverability(team_id:
|
31
|
+
expect { client.admin_teams_settings_setDiscoverability(team_id: %q[]) }.to raise_error ArgumentError, /Required arguments :discoverability missing/
|
32
32
|
end
|
33
33
|
it 'requires team_id' do
|
34
|
-
expect { client.admin_teams_settings_setDiscoverability(discoverability:
|
34
|
+
expect { client.admin_teams_settings_setDiscoverability(discoverability: %q[]) }.to raise_error ArgumentError, /Required arguments :team_id missing/
|
35
35
|
end
|
36
36
|
end
|
37
37
|
context 'admin.teams.settings_setIcon' do
|
38
38
|
it 'requires image_url' do
|
39
|
-
expect { client.admin_teams_settings_setIcon(team_id:
|
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:
|
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
|
46
46
|
it 'requires name' do
|
47
|
-
expect { client.admin_teams_settings_setName(team_id:
|
47
|
+
expect { client.admin_teams_settings_setName(team_id: %q[]) }.to raise_error ArgumentError, /Required arguments :name missing/
|
48
48
|
end
|
49
49
|
it 'requires team_id' do
|
50
|
-
expect { client.admin_teams_settings_setName(name:
|
50
|
+
expect { client.admin_teams_settings_setName(name: %q[]) }.to raise_error ArgumentError, /Required arguments :team_id missing/
|
51
51
|
end
|
52
52
|
end
|
53
53
|
end
|
@@ -7,10 +7,10 @@ RSpec.describe Slack::Web::Api::Endpoints::AdminTeams do
|
|
7
7
|
let(:client) { Slack::Web::Client.new }
|
8
8
|
context 'admin.teams_create' do
|
9
9
|
it 'requires team_domain' do
|
10
|
-
expect { client.admin_teams_create(team_name:
|
10
|
+
expect { client.admin_teams_create(team_name: %q[]) }.to raise_error ArgumentError, /Required arguments :team_domain missing/
|
11
11
|
end
|
12
12
|
it 'requires team_name' do
|
13
|
-
expect { client.admin_teams_create(team_domain:
|
13
|
+
expect { client.admin_teams_create(team_domain: %q[]) }.to raise_error ArgumentError, /Required arguments :team_name missing/
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|