slack-ruby-client 0.14.5 → 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/FUNDING.yml +1 -0
- data/.rubocop.yml +11 -3
- data/.rubocop_todo.yml +61 -23
- data/.travis.yml +1 -5
- data/CHANGELOG.md +43 -4
- data/CONTRIBUTING.md +17 -6
- data/Dangerfile +1 -1
- data/Gemfile +1 -2
- data/LICENSE.md +1 -1
- data/README.md +86 -52
- data/UPGRADING.md +20 -2
- data/bin/commands.rb +23 -0
- data/bin/commands/admin_analytics.rb +16 -0
- data/bin/commands/admin_apps.rb +15 -2
- data/bin/commands/admin_apps_approved.rb +17 -0
- data/bin/commands/admin_apps_restricted.rb +17 -0
- data/bin/commands/admin_barriers.rb +47 -0
- data/bin/commands/admin_conversations.rb +159 -0
- data/bin/commands/admin_conversations_ekm.rb +17 -0
- data/bin/commands/admin_conversations_restrictAccess.rb +37 -0
- data/bin/commands/admin_conversations_whitelist.rb +37 -0
- data/bin/commands/admin_emoji.rb +54 -0
- data/bin/commands/admin_inviteRequests.rb +36 -0
- data/bin/commands/admin_inviteRequests_approved.rb +16 -0
- data/bin/commands/admin_inviteRequests_denied.rb +16 -0
- data/bin/commands/admin_teams.rb +27 -0
- data/bin/commands/admin_teams_admins.rb +16 -0
- data/bin/commands/admin_teams_owners.rb +16 -0
- data/bin/commands/admin_teams_settings.rb +64 -0
- data/bin/commands/admin_usergroups.rb +48 -0
- data/bin/commands/admin_users.rb +97 -0
- data/bin/commands/admin_users_session.rb +22 -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/auth_teams.rb +16 -0
- data/bin/commands/bots.rb +1 -0
- data/bin/commands/calls.rb +52 -0
- data/bin/commands/calls_participants.rb +25 -0
- data/bin/commands/channels.rb +1 -155
- data/bin/commands/chat.rb +14 -12
- data/bin/commands/chat_scheduledMessages.rb +1 -0
- data/bin/commands/conversations.rb +15 -4
- data/bin/commands/dnd.rb +3 -1
- data/bin/commands/files.rb +7 -5
- data/bin/commands/files_remote.rb +3 -3
- 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 +1 -1
- data/bin/commands/pins.rb +0 -2
- data/bin/commands/reactions.rb +1 -0
- data/bin/commands/search.rb +4 -1
- data/bin/commands/team.rb +3 -0
- data/bin/commands/usergroups.rb +6 -1
- data/bin/commands/usergroups_users.rb +2 -0
- data/bin/commands/users.rb +5 -3
- data/bin/commands/users_profile.rb +5 -5
- data/bin/commands/views.rb +1 -1
- data/bin/commands/workflows.rb +38 -0
- data/lib/slack-ruby-client.rb +5 -4
- data/lib/slack/events/request.rb +7 -3
- data/lib/slack/messages/message.rb +0 -4
- data/lib/slack/real_time/client.rb +2 -1
- data/lib/slack/real_time/concurrency.rb +0 -2
- data/lib/slack/real_time/concurrency/async.rb +1 -3
- data/lib/slack/real_time/config.rb +5 -14
- data/lib/slack/real_time/models/base.rb +0 -4
- data/lib/slack/real_time/socket.rb +2 -2
- data/lib/slack/real_time/stores/base.rb +3 -1
- data/lib/slack/version.rb +1 -1
- data/lib/slack/web/api/endpoints.rb +47 -0
- data/lib/slack/web/api/endpoints/admin_analytics.rb +28 -0
- data/lib/slack/web/api/endpoints/admin_apps.rb +22 -2
- data/lib/slack/web/api/endpoints/admin_apps_approved.rb +35 -0
- data/lib/slack/web/api/endpoints/admin_apps_restricted.rb +35 -0
- data/lib/slack/web/api/endpoints/admin_barriers.rb +82 -0
- data/lib/slack/web/api/endpoints/admin_conversations.rb +246 -0
- data/lib/slack/web/api/endpoints/admin_conversations_ekm.rb +35 -0
- data/lib/slack/web/api/endpoints/admin_conversations_restrictAccess.rb +61 -0
- data/lib/slack/web/api/endpoints/admin_conversations_whitelist.rb +64 -0
- data/lib/slack/web/api/endpoints/admin_emoji.rb +88 -0
- data/lib/slack/web/api/endpoints/admin_inviteRequests.rb +61 -0
- data/lib/slack/web/api/endpoints/admin_inviteRequests_approved.rb +33 -0
- data/lib/slack/web/api/endpoints/admin_inviteRequests_denied.rb +33 -0
- data/lib/slack/web/api/endpoints/admin_teams.rb +50 -0
- data/lib/slack/web/api/endpoints/admin_teams_admins.rb +34 -0
- data/lib/slack/web/api/endpoints/admin_teams_owners.rb +34 -0
- data/lib/slack/web/api/endpoints/admin_teams_settings.rb +99 -0
- data/lib/slack/web/api/endpoints/admin_usergroups.rb +77 -0
- data/lib/slack/web/api/endpoints/admin_users.rb +161 -0
- data/lib/slack/web/api/endpoints/admin_users_session.rb +38 -0
- data/lib/slack/web/api/endpoints/api.rb +0 -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/auth_teams.rb +33 -0
- data/lib/slack/web/api/endpoints/bots.rb +2 -0
- data/lib/slack/web/api/endpoints/calls.rb +83 -0
- data/lib/slack/web/api/endpoints/calls_participants.rb +42 -0
- data/lib/slack/web/api/endpoints/channels.rb +1 -245
- data/lib/slack/web/api/endpoints/chat.rb +23 -19
- data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +3 -1
- data/lib/slack/web/api/endpoints/conversations.rb +37 -19
- data/lib/slack/web/api/endpoints/dnd.rb +4 -0
- data/lib/slack/web/api/endpoints/files.rb +8 -4
- data/lib/slack/web/api/endpoints/files_remote.rb +4 -4
- data/lib/slack/web/api/endpoints/groups.rb +0 -253
- data/lib/slack/web/api/endpoints/im.rb +0 -101
- data/lib/slack/web/api/endpoints/migration.rb +2 -0
- data/lib/slack/web/api/endpoints/mpim.rb +0 -96
- data/lib/slack/web/api/endpoints/oauth.rb +1 -4
- data/lib/slack/web/api/endpoints/pins.rb +3 -8
- data/lib/slack/web/api/endpoints/reactions.rb +5 -3
- data/lib/slack/web/api/endpoints/search.rb +6 -0
- data/lib/slack/web/api/endpoints/stars.rb +2 -2
- data/lib/slack/web/api/endpoints/team.rb +6 -0
- data/lib/slack/web/api/endpoints/usergroups.rb +10 -0
- data/lib/slack/web/api/endpoints/usergroups_users.rb +4 -0
- data/lib/slack/web/api/endpoints/users.rb +7 -5
- data/lib/slack/web/api/endpoints/users_profile.rb +3 -3
- data/lib/slack/web/api/endpoints/views.rb +1 -1
- data/lib/slack/web/api/endpoints/workflows.rb +61 -0
- data/lib/slack/web/api/errors.rb +848 -0
- data/lib/slack/web/api/errors/internal_error.rb +14 -0
- data/lib/slack/web/api/errors/slack_error.rb +12 -0
- data/lib/slack/web/api/mixins.rb +1 -0
- data/lib/slack/web/api/mixins/channels.id.rb +1 -3
- data/lib/slack/web/api/mixins/conversations.id.rb +25 -0
- data/lib/slack/web/api/mixins/groups.id.rb +1 -3
- data/lib/slack/web/api/mixins/ids.id.rb +3 -5
- data/lib/slack/web/api/mixins/users.id.rb +1 -3
- data/lib/slack/web/api/patches/{chat.6.block-kit-support.patch → chat.1.patch} +26 -24
- data/lib/slack/web/api/templates/endpoints.erb +1 -0
- data/lib/slack/web/api/templates/errors.erb +20 -0
- data/lib/slack/web/api/templates/method.erb +4 -1
- data/lib/slack/web/api/templates/method_spec.erb +1 -1
- data/lib/slack/web/client.rb +1 -1
- data/lib/slack/web/config.rb +2 -0
- data/lib/slack/web/faraday/connection.rb +23 -20
- data/lib/slack/web/faraday/response/raise_error.rb +16 -2
- data/lib/slack/web/faraday/response/wrap_error.rb +24 -0
- data/lib/slack/web/pagination/cursor.rb +2 -2
- data/lib/tasks/real_time.rake +1 -1
- data/lib/tasks/web.rake +21 -4
- data/slack-ruby-client.gemspec +5 -5
- data/spec/fixtures/slack/web/channels_info.yml +108 -15
- data/spec/fixtures/slack/web/{groups_info.yml → conversations_info.yml} +4 -4
- data/spec/fixtures/slack/web/conversations_setTopic.yml +69 -0
- data/spec/fixtures/slack/web/conversations_setTopic_one_page.yml +142 -0
- data/spec/fixtures/slack/web/conversations_setTopic_paginated.yml +208 -0
- data/spec/fixtures/slack/web/views_open_error.yml +76 -0
- data/spec/slack/events/request_spec.rb +13 -8
- data/spec/slack/real_time/client_spec.rb +18 -1
- 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/rtm_connect_spec.rb +1 -1
- data/spec/slack/real_time/rtm_start_spec.rb +1 -1
- data/spec/slack/web/api/endpoints/admin_analytics_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/admin_apps_approved_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_apps_restricted_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_apps_spec.rb +5 -0
- data/spec/slack/web/api/endpoints/admin_barriers_spec.rb +38 -0
- data/spec/slack/web/api/endpoints/admin_conversations_ekm_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_conversations_restrictAccess_spec.rb +32 -0
- data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +93 -0
- data/spec/slack/web/api/endpoints/admin_emoji_spec.rb +37 -0
- data/spec/slack/web/api/endpoints/admin_inviteRequests_approved_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_inviteRequests_denied_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_inviteRequests_spec.rb +18 -0
- data/spec/slack/web/api/endpoints/admin_teams_admins_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/admin_teams_owners_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/admin_teams_settings_spec.rb +53 -0
- data/spec/slack/web/api/endpoints/admin_teams_spec.rb +16 -0
- data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +37 -0
- data/spec/slack/web/api/endpoints/admin_users_session_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_users_spec.rb +67 -0
- data/spec/slack/web/api/endpoints/apps_connections_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/apps_event_authorizations_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/apps_permissions_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/apps_permissions_users_spec.rb +3 -3
- 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 +24 -0
- data/spec/slack/web/api/endpoints/calls_spec.rb +31 -0
- data/spec/slack/web/api/endpoints/conversations_spec.rb +20 -12
- data/spec/slack/web/api/endpoints/custom_specs/conversations_spec.rb +13 -0
- 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/im_spec.rb +0 -31
- data/spec/slack/web/api/endpoints/mpim_spec.rb +0 -31
- data/spec/slack/web/api/endpoints/oauth_spec.rb +3 -14
- 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/usergroups_users_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/workflows_spec.rb +26 -0
- data/spec/slack/web/api/errors/slack_error_spec.rb +22 -0
- data/spec/slack/web/api/mixins/channels_spec.rb +1 -1
- data/spec/slack/web/api/mixins/conversations_list_spec.rb +21 -0
- data/spec/slack/web/api/mixins/conversations_spec.rb +43 -0
- data/spec/slack/web/api/mixins/groups_spec.rb +1 -1
- data/spec/slack/web/api/mixins/users_spec.rb +1 -1
- data/spec/slack/web/client_spec.rb +121 -0
- data/spec/slack/web/faraday/response/raise_error_spec.rb +33 -9
- data/spec/support/vcr.rb +4 -0
- metadata +145 -55
- 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/patches/chat.1.text-attachments-required.patch +0 -13
- data/lib/slack/web/api/patches/chat.2.attachments-json.patch +0 -17
- data/lib/slack/web/api/patches/chat.3.update-attachments-support.patch +0 -21
- data/lib/slack/web/api/patches/chat.4.postEphemeral-attachments-support.patch +0 -17
- data/lib/slack/web/api/patches/chat.5.postEphemeral-text-or-attachments.patch +0 -15
- 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/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/views_spec.rb +0 -29
- data/spec/slack/web/api/errors/service_unavailable_spec.rb +0 -17
@@ -0,0 +1,76 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://slack.com/api/views.open
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: token=token&trigger_id=trigger_id&view=%7B%7D
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- application/json; charset=utf-8
|
12
|
+
User-Agent:
|
13
|
+
- Slack Ruby Client/0.14.6
|
14
|
+
Content-Type:
|
15
|
+
- application/x-www-form-urlencoded
|
16
|
+
Accept-Encoding:
|
17
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Content-Type:
|
24
|
+
- application/json; charset=utf-8
|
25
|
+
Content-Length:
|
26
|
+
- '154'
|
27
|
+
Connection:
|
28
|
+
- keep-alive
|
29
|
+
Date:
|
30
|
+
- Wed, 19 Feb 2020 17:52:59 GMT
|
31
|
+
Server:
|
32
|
+
- Apache
|
33
|
+
X-Content-Type-Options:
|
34
|
+
- nosniff
|
35
|
+
Expires:
|
36
|
+
- Mon, 26 Jul 1997 05:00:00 GMT
|
37
|
+
Cache-Control:
|
38
|
+
- private, no-cache, no-store, must-revalidate
|
39
|
+
X-Xss-Protection:
|
40
|
+
- '0'
|
41
|
+
Vary:
|
42
|
+
- Accept-Encoding
|
43
|
+
Pragma:
|
44
|
+
- no-cache
|
45
|
+
Access-Control-Allow-Headers:
|
46
|
+
- slack-route, x-slack-version-ts, x-b3-traceid, x-b3-spanid, x-b3-parentspanid,
|
47
|
+
x-b3-sampled, x-b3-flags
|
48
|
+
Strict-Transport-Security:
|
49
|
+
- max-age=31536000; includeSubDomains; preload
|
50
|
+
Referrer-Policy:
|
51
|
+
- no-referrer
|
52
|
+
X-Slack-Backend:
|
53
|
+
- h
|
54
|
+
Access-Control-Expose-Headers:
|
55
|
+
- x-slack-req-id, retry-after
|
56
|
+
Access-Control-Allow-Origin:
|
57
|
+
- "*"
|
58
|
+
X-Via:
|
59
|
+
- haproxy-www-ixj4
|
60
|
+
X-Cache:
|
61
|
+
- Miss from cloudfront
|
62
|
+
Via:
|
63
|
+
- 1.1 b6cc1359c0cd55a8339441d8abb6a450.cloudfront.net (CloudFront)
|
64
|
+
X-Amz-Cf-Pop:
|
65
|
+
- JFK51-C1
|
66
|
+
X-Amz-Cf-Id:
|
67
|
+
- fWF96IvY1omctxPC6XwjvZ2TIfpmVLlsT35MsfAWqK7zDChMCpE_oQ==
|
68
|
+
body:
|
69
|
+
encoding: ASCII-8BIT
|
70
|
+
string: '{"ok":false,"error":"invalid_arguments","response_metadata":{"messages":["[ERROR]
|
71
|
+
missing required field: title [json-pointer:\/view]","[ERROR] missing required
|
72
|
+
field: blocks [json-pointer:\/view]","[ERROR] missing required field: type
|
73
|
+
[json-pointer:\/view]"]}}'
|
74
|
+
http_version: null
|
75
|
+
recorded_at: Wed, 19 Feb 2020 17:52:59 GMT
|
76
|
+
recorded_with: VCR 5.1.0
|
@@ -21,15 +21,14 @@ RSpec.describe Slack::Events::Request do
|
|
21
21
|
'"P7sFXA4o3HV2hTx4zb4zcQ9yrvuQs8pDh6EacOxmMRj0tJaXfQFF","type":"url_verification"}'
|
22
22
|
end
|
23
23
|
let(:http_request) do
|
24
|
-
double(
|
25
|
-
|
26
|
-
'X-Slack-Request-Timestamp' => timestamp,
|
27
|
-
'X-Slack-Signature' => signature
|
28
|
-
},
|
29
|
-
body: double(
|
30
|
-
read: body
|
31
|
-
)
|
24
|
+
request_double = double(
|
25
|
+
body: StringIO.new(body)
|
32
26
|
)
|
27
|
+
|
28
|
+
allow(request_double).to receive(:get_header).with('HTTP_X_SLACK_REQUEST_TIMESTAMP') { timestamp }
|
29
|
+
allow(request_double).to receive(:get_header).with('HTTP_X_SLACK_SIGNATURE') { signature }
|
30
|
+
|
31
|
+
request_double
|
33
32
|
end
|
34
33
|
|
35
34
|
after do
|
@@ -42,6 +41,12 @@ RSpec.describe Slack::Events::Request do
|
|
42
41
|
expect(request.timestamp).to eq timestamp
|
43
42
|
expect(request.version).to eq 'v0'
|
44
43
|
end
|
44
|
+
|
45
|
+
it 'rewinds the request body after reading it' do
|
46
|
+
expect(request.body).to eq body
|
47
|
+
expect(http_request.body.read).to eq body
|
48
|
+
end
|
49
|
+
|
45
50
|
context 'time' do
|
46
51
|
after do
|
47
52
|
Timecop.return
|
@@ -1,7 +1,7 @@
|
|
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
|
@@ -166,6 +166,23 @@ RSpec.describe Slack::RealTime::Client do # rubocop:disable Metrics/BlockLength
|
|
166
166
|
expect(client.store.team.name).to eq 'New Team Name Inc.'
|
167
167
|
end
|
168
168
|
end
|
169
|
+
|
170
|
+
describe '#run_handlers' do
|
171
|
+
describe 'empty events' do
|
172
|
+
before do
|
173
|
+
@e = client.store.class.events
|
174
|
+
client.store.class.events = nil
|
175
|
+
end
|
176
|
+
|
177
|
+
after do
|
178
|
+
client.store.class.events = @e
|
179
|
+
end
|
180
|
+
|
181
|
+
it 'returns false when event is nil' do
|
182
|
+
expect(client.send(:run_handlers, 'example', {})).to be nil
|
183
|
+
end
|
184
|
+
end
|
185
|
+
end
|
169
186
|
end
|
170
187
|
|
171
188
|
describe '#start_async' 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
|
@@ -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
|
|
@@ -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,9 @@ 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
|
8
13
|
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
|
@@ -0,0 +1,32 @@
|
|
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::AdminConversationsRestrictaccess do
|
7
|
+
let(:client) { Slack::Web::Client.new }
|
8
|
+
context 'admin.conversations.restrictAccess_addGroup' do
|
9
|
+
it 'requires channel_id' do
|
10
|
+
expect { client.admin_conversations_restrictAccess_addGroup(group_id: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
11
|
+
end
|
12
|
+
it 'requires group_id' do
|
13
|
+
expect { client.admin_conversations_restrictAccess_addGroup(channel_id: %q[]) }.to raise_error ArgumentError, /Required arguments :group_id missing/
|
14
|
+
end
|
15
|
+
end
|
16
|
+
context 'admin.conversations.restrictAccess_listGroups' do
|
17
|
+
it 'requires channel_id' do
|
18
|
+
expect { client.admin_conversations_restrictAccess_listGroups }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
19
|
+
end
|
20
|
+
end
|
21
|
+
context 'admin.conversations.restrictAccess_removeGroup' do
|
22
|
+
it 'requires channel_id' do
|
23
|
+
expect { client.admin_conversations_restrictAccess_removeGroup(group_id: %q[], team_id: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
24
|
+
end
|
25
|
+
it 'requires group_id' do
|
26
|
+
expect { client.admin_conversations_restrictAccess_removeGroup(channel_id: %q[], team_id: %q[]) }.to raise_error ArgumentError, /Required arguments :group_id missing/
|
27
|
+
end
|
28
|
+
it 'requires team_id' do
|
29
|
+
expect { client.admin_conversations_restrictAccess_removeGroup(channel_id: %q[], group_id: %q[]) }.to raise_error ArgumentError, /Required arguments :team_id missing/
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,93 @@
|
|
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::AdminConversations do
|
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[mychannel]) }.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[true]) }.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_getConversationPrefs' do
|
32
|
+
it 'requires channel_id' do
|
33
|
+
expect { client.admin_conversations_getConversationPrefs }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
34
|
+
end
|
35
|
+
end
|
36
|
+
context 'admin.conversations_getCustomRetention' do
|
37
|
+
it 'requires channel_id' do
|
38
|
+
expect { client.admin_conversations_getCustomRetention }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
39
|
+
end
|
40
|
+
end
|
41
|
+
context 'admin.conversations_getTeams' do
|
42
|
+
it 'requires channel_id' do
|
43
|
+
expect { client.admin_conversations_getTeams }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
44
|
+
end
|
45
|
+
end
|
46
|
+
context 'admin.conversations_invite' do
|
47
|
+
it 'requires channel_id' do
|
48
|
+
expect { client.admin_conversations_invite(user_ids: %q[U1234,U2345,U3456]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
49
|
+
end
|
50
|
+
it 'requires user_ids' do
|
51
|
+
expect { client.admin_conversations_invite(channel_id: %q[C12345]) }.to raise_error ArgumentError, /Required arguments :user_ids missing/
|
52
|
+
end
|
53
|
+
end
|
54
|
+
context 'admin.conversations_removeCustomRetention' do
|
55
|
+
it 'requires channel_id' do
|
56
|
+
expect { client.admin_conversations_removeCustomRetention }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
57
|
+
end
|
58
|
+
end
|
59
|
+
context 'admin.conversations_rename' do
|
60
|
+
it 'requires channel_id' do
|
61
|
+
expect { client.admin_conversations_rename(name: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
62
|
+
end
|
63
|
+
it 'requires name' do
|
64
|
+
expect { client.admin_conversations_rename(channel_id: %q[C12345]) }.to raise_error ArgumentError, /Required arguments :name missing/
|
65
|
+
end
|
66
|
+
end
|
67
|
+
context 'admin.conversations_setConversationPrefs' do
|
68
|
+
it 'requires channel_id' do
|
69
|
+
expect { client.admin_conversations_setConversationPrefs(prefs: %q[{'who_can_post':'type:admin,user:U1234,subteam:S1234'}]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
70
|
+
end
|
71
|
+
it 'requires prefs' do
|
72
|
+
expect { client.admin_conversations_setConversationPrefs(channel_id: %q[C1234]) }.to raise_error ArgumentError, /Required arguments :prefs missing/
|
73
|
+
end
|
74
|
+
end
|
75
|
+
context 'admin.conversations_setCustomRetention' do
|
76
|
+
it 'requires channel_id' do
|
77
|
+
expect { client.admin_conversations_setCustomRetention(duration_days: %q[500]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
78
|
+
end
|
79
|
+
it 'requires duration_days' do
|
80
|
+
expect { client.admin_conversations_setCustomRetention(channel_id: %q[C12345678]) }.to raise_error ArgumentError, /Required arguments :duration_days missing/
|
81
|
+
end
|
82
|
+
end
|
83
|
+
context 'admin.conversations_setTeams' do
|
84
|
+
it 'requires channel_id' do
|
85
|
+
expect { client.admin_conversations_setTeams }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
86
|
+
end
|
87
|
+
end
|
88
|
+
context 'admin.conversations_unarchive' do
|
89
|
+
it 'requires channel_id' do
|
90
|
+
expect { client.admin_conversations_unarchive }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
@@ -0,0 +1,37 @@
|
|
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::AdminEmoji do
|
7
|
+
let(:client) { Slack::Web::Client.new }
|
8
|
+
context 'admin.emoji_add' do
|
9
|
+
it 'requires name' do
|
10
|
+
expect { client.admin_emoji_add(url: %q[]) }.to raise_error ArgumentError, /Required arguments :name missing/
|
11
|
+
end
|
12
|
+
it 'requires url' do
|
13
|
+
expect { client.admin_emoji_add(name: %q[]) }.to raise_error ArgumentError, /Required arguments :url missing/
|
14
|
+
end
|
15
|
+
end
|
16
|
+
context 'admin.emoji_addAlias' do
|
17
|
+
it 'requires alias_for' do
|
18
|
+
expect { client.admin_emoji_addAlias(name: %q[]) }.to raise_error ArgumentError, /Required arguments :alias_for missing/
|
19
|
+
end
|
20
|
+
it 'requires name' do
|
21
|
+
expect { client.admin_emoji_addAlias(alias_for: %q[]) }.to raise_error ArgumentError, /Required arguments :name missing/
|
22
|
+
end
|
23
|
+
end
|
24
|
+
context 'admin.emoji_remove' do
|
25
|
+
it 'requires name' do
|
26
|
+
expect { client.admin_emoji_remove }.to raise_error ArgumentError, /Required arguments :name missing/
|
27
|
+
end
|
28
|
+
end
|
29
|
+
context 'admin.emoji_rename' do
|
30
|
+
it 'requires name' do
|
31
|
+
expect { client.admin_emoji_rename(new_name: %q[]) }.to raise_error ArgumentError, /Required arguments :name missing/
|
32
|
+
end
|
33
|
+
it 'requires new_name' do
|
34
|
+
expect { client.admin_emoji_rename(name: %q[]) }.to raise_error ArgumentError, /Required arguments :new_name missing/
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|