slack-ruby-client 2.1.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.coveralls.yml +2 -0
- data/.github/workflows/test.yml +6 -0
- data/.github/workflows/update_api.yml +76 -0
- data/.gitignore +1 -0
- data/.rubocop_todo.yml +17 -29
- data/CHANGELOG.md +23 -1
- data/CONTRIBUTING.md +35 -32
- data/Gemfile +2 -0
- data/README.md +123 -14
- data/bin/commands/admin_apps_activities.rb +32 -0
- data/bin/commands/admin_apps_approved.rb +1 -0
- data/bin/commands/admin_apps_config.rb +31 -0
- data/bin/commands/admin_apps_requests.rb +1 -0
- data/bin/commands/admin_apps_restricted.rb +1 -0
- data/bin/commands/admin_functions.rb +23 -0
- data/bin/commands/admin_functions_permissions.rb +31 -0
- data/bin/commands/admin_roles.rb +1 -1
- data/bin/commands/admin_teams.rb +1 -1
- data/bin/commands/admin_users.rb +2 -2
- data/bin/commands/admin_workflows.rb +38 -0
- data/bin/commands/admin_workflows_collaborators.rb +31 -0
- data/bin/commands/admin_workflows_permissions.rb +21 -0
- data/bin/commands/apps_activities.rb +32 -0
- data/bin/commands/apps_auth_external.rb +32 -0
- data/bin/commands/apps_datastore.rb +70 -0
- data/bin/commands/auth_teams.rb +2 -2
- data/bin/commands/calls.rb +1 -1
- data/bin/commands/chat.rb +6 -6
- data/bin/commands/chat_scheduledMessages.rb +2 -2
- data/bin/commands/conversations.rb +3 -3
- data/bin/commands/dnd.rb +1 -1
- data/bin/commands/functions_workflows_steps.rb +2 -1
- data/bin/commands/functions_workflows_steps_responses.rb +2 -1
- data/bin/commands/reminders.rb +1 -1
- data/bin/commands/stars.rb +4 -4
- data/bin/commands/team.rb +3 -1
- data/bin/commands/users.rb +1 -1
- data/lib/slack/messages/formatting.rb +44 -0
- data/lib/slack/real_time/client.rb +14 -2
- data/lib/slack/real_time/concurrency/async.rb +4 -0
- data/lib/slack/real_time/config.rb +3 -0
- data/lib/slack/real_time/socket.rb +4 -0
- data/lib/slack/real_time/stores/starter.rb +2 -2
- data/lib/slack/real_time/stores/store.rb +2 -2
- data/lib/slack/version.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_apps_activities.rb +53 -0
- data/lib/slack/web/api/endpoints/admin_apps_approved.rb +2 -0
- data/lib/slack/web/api/endpoints/admin_apps_config.rb +40 -0
- data/lib/slack/web/api/endpoints/admin_apps_requests.rb +2 -0
- data/lib/slack/web/api/endpoints/admin_apps_restricted.rb +2 -0
- data/lib/slack/web/api/endpoints/admin_conversations.rb +1 -0
- data/lib/slack/web/api/endpoints/admin_functions.rb +36 -0
- data/lib/slack/web/api/endpoints/admin_functions_permissions.rb +41 -0
- data/lib/slack/web/api/endpoints/admin_roles.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_teams.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_users.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_workflows.rb +59 -0
- data/lib/slack/web/api/endpoints/admin_workflows_collaborators.rb +42 -0
- data/lib/slack/web/api/endpoints/admin_workflows_permissions.rb +26 -0
- data/lib/slack/web/api/endpoints/apps_activities.rb +54 -0
- data/lib/slack/web/api/endpoints/apps_auth_external.rb +41 -0
- data/lib/slack/web/api/endpoints/apps_datastore.rb +110 -0
- data/lib/slack/web/api/endpoints/apps_manifest.rb +2 -0
- data/lib/slack/web/api/endpoints/auth_teams.rb +1 -1
- data/lib/slack/web/api/endpoints/calls.rb +1 -1
- data/lib/slack/web/api/endpoints/chat.rb +14 -45
- data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +2 -2
- data/lib/slack/web/api/endpoints/conversations.rb +3 -3
- data/lib/slack/web/api/endpoints/dialog.rb +1 -6
- data/lib/slack/web/api/endpoints/dnd.rb +1 -1
- data/lib/slack/web/api/endpoints/functions_workflows_steps.rb +3 -1
- data/lib/slack/web/api/endpoints/functions_workflows_steps_responses.rb +3 -1
- data/lib/slack/web/api/endpoints/reminders.rb +1 -1
- data/lib/slack/web/api/endpoints/stars.rb +2 -2
- data/lib/slack/web/api/endpoints/team.rb +12 -2
- data/lib/slack/web/api/endpoints/users.rb +1 -1
- data/lib/slack/web/api/endpoints/users_profile.rb +1 -0
- data/lib/slack/web/api/endpoints/views.rb +7 -23
- data/lib/slack/web/api/endpoints/workflows.rb +2 -0
- data/lib/slack/web/api/endpoints.rb +20 -0
- data/lib/slack/web/api/errors.rb +66 -4
- data/lib/slack/web/api/options.rb +26 -0
- data/lib/slack/web/api/patches/chat.attachments-blocks.patch +7 -55
- data/lib/slack/web/api/templates/method.erb +12 -0
- data/lib/slack/web/api/templates/method_spec.erb +40 -4
- data/lib/slack/web/client.rb +1 -0
- data/lib/slack-ruby-client.rb +1 -0
- data/lib/tasks/web.rake +2 -4
- data/slack-ruby-client.gemspec +1 -0
- data/spec/slack/messages/formatting_spec.rb +60 -0
- data/spec/slack/real_time/client_spec.rb +25 -7
- data/spec/slack/real_time/concurrency/clients/async_spec.rb +16 -0
- data/spec/slack/web/api/endpoints/admin_apps_activities_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_apps_config_spec.rb +18 -0
- data/spec/slack/web/api/endpoints/admin_auth_policy_spec.rb +6 -6
- data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +14 -10
- data/spec/slack/web/api/endpoints/admin_functions_permissions_spec.rb +21 -0
- data/spec/slack/web/api/endpoints/admin_functions_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/admin_roles_spec.rb +6 -6
- 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 +2 -2
- data/spec/slack/web/api/endpoints/admin_users_spec.rb +8 -8
- data/spec/slack/web/api/endpoints/admin_workflows_collaborators_spec.rb +24 -0
- data/spec/slack/web/api/endpoints/admin_workflows_permissions_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/admin_workflows_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/apps_activities_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/apps_auth_external_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/apps_datastore_spec.rb +45 -0
- data/spec/slack/web/api/endpoints/apps_manifest_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/apps_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/auth_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/bookmarks_spec.rb +4 -4
- 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/chat_spec.rb +62 -0
- data/spec/slack/web/api/endpoints/conversations_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +3 -3
- data/spec/slack/web/api/endpoints/custom_specs/views_spec.rb +1 -1
- data/spec/slack/web/api/endpoints/dialog_spec.rb +14 -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 +2 -2
- data/spec/slack/web/api/endpoints/oauth_v2_spec.rb +2 -2
- 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/users_profile_spec.rb +6 -0
- data/spec/slack/web/api/endpoints/users_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/views_spec.rb +65 -0
- data/spec/slack/web/api/endpoints/workflows_spec.rb +8 -0
- data/spec/slack/web/api/options_spec.rb +69 -0
- data/spec/spec_helper.rb +9 -0
- metadata +45 -5
- data/lib/slack/web/api/patches/dialog.encoded-json.patch +0 -17
- data/lib/slack/web/api/patches/views.view-json.patch +0 -55
data/lib/slack-ruby-client.rb
CHANGED
@@ -30,6 +30,7 @@ require_relative 'slack/web/api/errors/too_many_requests_error'
|
|
30
30
|
require_relative 'slack/web/api/error'
|
31
31
|
require_relative 'slack/web/api/errors'
|
32
32
|
require_relative 'slack/web/api/errors/server_error'
|
33
|
+
require_relative 'slack/web/api/options'
|
33
34
|
require_relative 'slack/web/faraday/response/raise_error'
|
34
35
|
require_relative 'slack/web/faraday/response/wrap_error'
|
35
36
|
require_relative 'slack/web/faraday/connection'
|
data/lib/tasks/web.rake
CHANGED
@@ -58,10 +58,8 @@ namespace :slack do
|
|
58
58
|
File.write "lib/slack/web/api/endpoints/#{snaked_group}.rb", rendered_method
|
59
59
|
custom_spec_exists =
|
60
60
|
File.exist?("spec/slack/web/api/endpoints/custom_specs/#{group}_spec.rb")
|
61
|
-
|
62
|
-
|
63
|
-
File.write "spec/slack/web/api/endpoints/#{snaked_group}_spec.rb", rendered_method_spec
|
64
|
-
end
|
61
|
+
rendered_method_spec = method_spec_template.result(group: group, names: names, custom_spec_exists: custom_spec_exists)
|
62
|
+
File.write "spec/slack/web/api/endpoints/#{snaked_group}_spec.rb", rendered_method_spec
|
65
63
|
|
66
64
|
unless ENV.key?('SKIP_PATCH')
|
67
65
|
Dir.glob("lib/slack/web/api/patches/#{group}*.patch").sort.each do |patch|
|
data/slack-ruby-client.gemspec
CHANGED
@@ -61,4 +61,64 @@ describe Slack::Messages::Formatting do
|
|
61
61
|
expect(formatting.unescape('‘hello’')).to eq "'hello'"
|
62
62
|
end
|
63
63
|
end
|
64
|
+
|
65
|
+
context '#escape' do
|
66
|
+
it 'plain text' do
|
67
|
+
expect(formatting.escape('plain text')).to eq 'plain text'
|
68
|
+
end
|
69
|
+
|
70
|
+
it 'escapes a message' do
|
71
|
+
expect(formatting.escape('Hello & <world>')).to eq 'Hello & <world>'
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
context '#date' do
|
76
|
+
let(:timestamp) { -2955646679 }
|
77
|
+
let(:time) { Time.at(timestamp) }
|
78
|
+
let(:custom_format) { '{date_short}' }
|
79
|
+
let(:optional_link) { 'https://www.timeanddate.com/worldclock/fixedtime.html?year=1876&month=5&day=4&hour=03&min=02&sec=01' }
|
80
|
+
let(:fallback_text) { 'a long, long time ago' }
|
81
|
+
|
82
|
+
it 'formats a timestamp' do
|
83
|
+
expect(formatting.date(time)).to eq "<!date^#{timestamp}^{date_num} {time_secs}|#{time}>"
|
84
|
+
end
|
85
|
+
|
86
|
+
it 'can use custom format' do
|
87
|
+
expect(formatting.date(time, format: custom_format)).to eq "<!date^#{timestamp}^#{custom_format}|#{time}>"
|
88
|
+
end
|
89
|
+
|
90
|
+
it 'can add a custom link' do
|
91
|
+
expect(formatting.date(time,
|
92
|
+
link: optional_link)).to eq "<!date^#{timestamp}^{date_num} {time_secs}^#{optional_link}|#{time}>"
|
93
|
+
end
|
94
|
+
|
95
|
+
it 'can add custom fallback text' do
|
96
|
+
expect(formatting.date(time, text: fallback_text)).to eq "<!date^#{timestamp}^{date_num} {time_secs}|#{fallback_text}>"
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
context '#channel_link' do
|
101
|
+
let(:channel_id) { 'C0000000001' }
|
102
|
+
|
103
|
+
it 'links to a channel by its ID' do
|
104
|
+
expect(formatting.channel_link(channel_id)).to eq "<##{channel_id}>"
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
context '#user_link' do
|
109
|
+
let(:user_id) { 'U0000000001' }
|
110
|
+
|
111
|
+
it 'links to a user by its ID' do
|
112
|
+
expect(formatting.user_link(user_id)).to eq "<@#{user_id}>"
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
context '#url_link' do
|
117
|
+
let(:text) { 'super cool website' }
|
118
|
+
let(:url) { 'https://theuselessweb.site/' }
|
119
|
+
|
120
|
+
it 'formats a URL with custom link text' do
|
121
|
+
expect(formatting.url_link(text, url)).to eq "<#{url}|#{text}>"
|
122
|
+
end
|
123
|
+
end
|
64
124
|
end
|
@@ -159,18 +159,36 @@ RSpec.describe Slack::RealTime::Client do
|
|
159
159
|
end
|
160
160
|
|
161
161
|
describe '#run_handlers' do
|
162
|
-
|
162
|
+
before do
|
163
|
+
@events = client.store.class.events.dup
|
164
|
+
@async_handlers = client.async_handlers.dup
|
165
|
+
client.store.class.events.clear
|
166
|
+
end
|
167
|
+
|
168
|
+
after do
|
169
|
+
client.store.class.events.merge!(@events)
|
170
|
+
client.async_handlers = @async_handlers
|
171
|
+
end
|
172
|
+
|
173
|
+
context 'when config#async_handlers is :all' do
|
163
174
|
before do
|
164
|
-
|
165
|
-
client.store.class.events.clear
|
175
|
+
client.async_handlers = :all
|
166
176
|
end
|
167
177
|
|
168
|
-
|
169
|
-
|
178
|
+
it 'runs tasks async' do
|
179
|
+
expect(socket).to receive(:run_async)
|
180
|
+
client.send(:run_handlers, 'example', {})
|
181
|
+
end
|
182
|
+
end
|
183
|
+
|
184
|
+
context 'when config#async_handlers is :none' do
|
185
|
+
before do
|
186
|
+
client.async_handlers = :none
|
170
187
|
end
|
171
188
|
|
172
|
-
it '
|
173
|
-
expect(
|
189
|
+
it 'does not run tasks async' do
|
190
|
+
expect(socket).not_to receive(:run_async)
|
191
|
+
client.send(:run_handlers, 'example', {})
|
174
192
|
end
|
175
193
|
end
|
176
194
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
RSpec.describe 'Slack::RealTime::Concurrency::Async::Socket', skip: (
|
5
|
+
ENV['CONCURRENCY'] != 'async-websocket'
|
6
|
+
) do
|
7
|
+
context 'global config' do
|
8
|
+
let(:client) { Slack::RealTime::Concurrency::Async::Socket.new(nil) }
|
9
|
+
|
10
|
+
context 'run_async' do
|
11
|
+
it 'returns an Async::Task' do
|
12
|
+
expect(client.run_async {}).to be_a Async::Task
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,18 @@
|
|
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::AdminAppsConfig do
|
7
|
+
let(:client) { Slack::Web::Client.new }
|
8
|
+
context 'admin.apps.config_lookup' do
|
9
|
+
it 'requires app_ids' do
|
10
|
+
expect { client.admin_apps_config_lookup }.to raise_error ArgumentError, /Required arguments :app_ids missing/
|
11
|
+
end
|
12
|
+
end
|
13
|
+
context 'admin.apps.config_set' do
|
14
|
+
it 'requires app_id' do
|
15
|
+
expect { client.admin_apps_config_set }.to raise_error ArgumentError, /Required arguments :app_id missing/
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -7,13 +7,13 @@ RSpec.describe Slack::Web::Api::Endpoints::AdminAuthPolicy do
|
|
7
7
|
let(:client) { Slack::Web::Client.new }
|
8
8
|
context 'admin.auth.policy_assignEntities' do
|
9
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/
|
10
|
+
expect { client.admin_auth_policy_assignEntities(entity_type: %q[], policy_name: %q[email_password]) }.to raise_error ArgumentError, /Required arguments :entity_ids missing/
|
11
11
|
end
|
12
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/
|
13
|
+
expect { client.admin_auth_policy_assignEntities(entity_ids: %q[['U12345','U27345']], policy_name: %q[email_password]) }.to raise_error ArgumentError, /Required arguments :entity_type missing/
|
14
14
|
end
|
15
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/
|
16
|
+
expect { client.admin_auth_policy_assignEntities(entity_ids: %q[['U12345','U27345']], entity_type: %q[]) }.to raise_error ArgumentError, /Required arguments :policy_name missing/
|
17
17
|
end
|
18
18
|
end
|
19
19
|
context 'admin.auth.policy_getEntities' do
|
@@ -23,13 +23,13 @@ RSpec.describe Slack::Web::Api::Endpoints::AdminAuthPolicy do
|
|
23
23
|
end
|
24
24
|
context 'admin.auth.policy_removeEntities' do
|
25
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/
|
26
|
+
expect { client.admin_auth_policy_removeEntities(entity_type: %q[], policy_name: %q[email_password]) }.to raise_error ArgumentError, /Required arguments :entity_ids missing/
|
27
27
|
end
|
28
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/
|
29
|
+
expect { client.admin_auth_policy_removeEntities(entity_ids: %q[['U1234']], policy_name: %q[email_password]) }.to raise_error ArgumentError, /Required arguments :entity_type missing/
|
30
30
|
end
|
31
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/
|
32
|
+
expect { client.admin_auth_policy_removeEntities(entity_ids: %q[['U1234']], entity_type: %q[]) }.to raise_error ArgumentError, /Required arguments :policy_name missing/
|
33
33
|
end
|
34
34
|
end
|
35
35
|
end
|
@@ -22,7 +22,7 @@ RSpec.describe Slack::Web::Api::Endpoints::AdminConversations do
|
|
22
22
|
end
|
23
23
|
context 'admin.conversations_bulkMove' do
|
24
24
|
it 'requires channel_ids' do
|
25
|
-
expect { client.admin_conversations_bulkMove(target_team_id: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_ids missing/
|
25
|
+
expect { client.admin_conversations_bulkMove(target_team_id: %q[T1234567890]) }.to raise_error ArgumentError, /Required arguments :channel_ids missing/
|
26
26
|
end
|
27
27
|
it 'requires target_team_id' do
|
28
28
|
expect { client.admin_conversations_bulkMove(channel_ids: %q[]) }.to raise_error ArgumentError, /Required arguments :target_team_id missing/
|
@@ -40,10 +40,10 @@ RSpec.describe Slack::Web::Api::Endpoints::AdminConversations do
|
|
40
40
|
end
|
41
41
|
context 'admin.conversations_create' do
|
42
42
|
it 'requires is_private' do
|
43
|
-
expect { client.admin_conversations_create(name: %q[]) }.to raise_error ArgumentError, /Required arguments :is_private missing/
|
43
|
+
expect { client.admin_conversations_create(name: %q[mychannel]) }.to raise_error ArgumentError, /Required arguments :is_private missing/
|
44
44
|
end
|
45
45
|
it 'requires name' do
|
46
|
-
expect { client.admin_conversations_create(is_private: %q[]) }.to raise_error ArgumentError, /Required arguments :name missing/
|
46
|
+
expect { client.admin_conversations_create(is_private: %q[true]) }.to raise_error ArgumentError, /Required arguments :name missing/
|
47
47
|
end
|
48
48
|
end
|
49
49
|
context 'admin.conversations_delete' do
|
@@ -73,10 +73,10 @@ RSpec.describe Slack::Web::Api::Endpoints::AdminConversations do
|
|
73
73
|
end
|
74
74
|
context 'admin.conversations_invite' do
|
75
75
|
it 'requires channel_id' do
|
76
|
-
expect { client.admin_conversations_invite(user_ids: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
76
|
+
expect { client.admin_conversations_invite(user_ids: %q[U1234,U2345,U3456]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
77
77
|
end
|
78
78
|
it 'requires user_ids' do
|
79
|
-
expect { client.admin_conversations_invite(channel_id: %q[]) }.to raise_error ArgumentError, /Required arguments :user_ids missing/
|
79
|
+
expect { client.admin_conversations_invite(channel_id: %q[C12345]) }.to raise_error ArgumentError, /Required arguments :user_ids missing/
|
80
80
|
end
|
81
81
|
end
|
82
82
|
context 'admin.conversations_lookup' do
|
@@ -97,23 +97,27 @@ RSpec.describe Slack::Web::Api::Endpoints::AdminConversations do
|
|
97
97
|
expect { client.admin_conversations_rename(name: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
98
98
|
end
|
99
99
|
it 'requires name' do
|
100
|
-
expect { client.admin_conversations_rename(channel_id: %q[]) }.to raise_error ArgumentError, /Required arguments :name missing/
|
100
|
+
expect { client.admin_conversations_rename(channel_id: %q[C12345]) }.to raise_error ArgumentError, /Required arguments :name missing/
|
101
101
|
end
|
102
102
|
end
|
103
103
|
context 'admin.conversations_setConversationPrefs' do
|
104
104
|
it 'requires channel_id' do
|
105
|
-
expect { client.admin_conversations_setConversationPrefs(prefs: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
105
|
+
expect { client.admin_conversations_setConversationPrefs(prefs: %q[{'who_can_post':'type:admin,user:U1234'}]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
106
106
|
end
|
107
107
|
it 'requires prefs' do
|
108
|
-
expect { client.admin_conversations_setConversationPrefs(channel_id: %q[]) }.to raise_error ArgumentError, /Required arguments :prefs missing/
|
108
|
+
expect { client.admin_conversations_setConversationPrefs(channel_id: %q[C1234]) }.to raise_error ArgumentError, /Required arguments :prefs missing/
|
109
|
+
end
|
110
|
+
it 'encodes prefs as json' do
|
111
|
+
expect(client).to receive(:post).with('admin.conversations.setConversationPrefs', {channel_id: %q[C1234], prefs: %q[{"data":["data"]}]})
|
112
|
+
client.admin_conversations_setConversationPrefs(channel_id: %q[C1234], prefs: {:data=>["data"]})
|
109
113
|
end
|
110
114
|
end
|
111
115
|
context 'admin.conversations_setCustomRetention' do
|
112
116
|
it 'requires channel_id' do
|
113
|
-
expect { client.admin_conversations_setCustomRetention(duration_days: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
117
|
+
expect { client.admin_conversations_setCustomRetention(duration_days: %q[500]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
114
118
|
end
|
115
119
|
it 'requires duration_days' do
|
116
|
-
expect { client.admin_conversations_setCustomRetention(channel_id: %q[]) }.to raise_error ArgumentError, /Required arguments :duration_days missing/
|
120
|
+
expect { client.admin_conversations_setCustomRetention(channel_id: %q[C12345678]) }.to raise_error ArgumentError, /Required arguments :duration_days missing/
|
117
121
|
end
|
118
122
|
end
|
119
123
|
context 'admin.conversations_setTeams' do
|
@@ -0,0 +1,21 @@
|
|
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::AdminFunctionsPermissions do
|
7
|
+
let(:client) { Slack::Web::Client.new }
|
8
|
+
context 'admin.functions.permissions_lookup' do
|
9
|
+
it 'requires function_ids' do
|
10
|
+
expect { client.admin_functions_permissions_lookup }.to raise_error ArgumentError, /Required arguments :function_ids missing/
|
11
|
+
end
|
12
|
+
end
|
13
|
+
context 'admin.functions.permissions_set' do
|
14
|
+
it 'requires function_id' do
|
15
|
+
expect { client.admin_functions_permissions_set(visibility: %q[]) }.to raise_error ArgumentError, /Required arguments :function_id missing/
|
16
|
+
end
|
17
|
+
it 'requires visibility' do
|
18
|
+
expect { client.admin_functions_permissions_set(function_id: %q[]) }.to raise_error ArgumentError, /Required arguments :visibility missing/
|
19
|
+
end
|
20
|
+
end
|
21
|
+
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::AdminFunctions do
|
7
|
+
let(:client) { Slack::Web::Client.new }
|
8
|
+
context 'admin.functions_list' do
|
9
|
+
it 'requires app_ids' do
|
10
|
+
expect { client.admin_functions_list }.to raise_error ArgumentError, /Required arguments :app_ids missing/
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -7,24 +7,24 @@ RSpec.describe Slack::Web::Api::Endpoints::AdminRoles do
|
|
7
7
|
let(:client) { Slack::Web::Client.new }
|
8
8
|
context 'admin.roles_addAssignments' do
|
9
9
|
it 'requires entity_ids' do
|
10
|
-
expect { client.admin_roles_addAssignments(role_id: %q[], user_ids: %q[]) }.to raise_error ArgumentError, /Required arguments :entity_ids missing/
|
10
|
+
expect { client.admin_roles_addAssignments(role_id: %q[R0001], user_ids: %q[['U00000001', 'U00000002', 'U00000003']]) }.to raise_error ArgumentError, /Required arguments :entity_ids missing/
|
11
11
|
end
|
12
12
|
it 'requires role_id' do
|
13
|
-
expect { client.admin_roles_addAssignments(entity_ids: %q[], user_ids: %q[]) }.to raise_error ArgumentError, /Required arguments :role_id missing/
|
13
|
+
expect { client.admin_roles_addAssignments(entity_ids: %q[['T00000001', 'E00000002']], user_ids: %q[['U00000001', 'U00000002', 'U00000003']]) }.to raise_error ArgumentError, /Required arguments :role_id missing/
|
14
14
|
end
|
15
15
|
it 'requires user_ids' do
|
16
|
-
expect { client.admin_roles_addAssignments(entity_ids: %q[], role_id: %q[]) }.to raise_error ArgumentError, /Required arguments :user_ids missing/
|
16
|
+
expect { client.admin_roles_addAssignments(entity_ids: %q[['T00000001', 'E00000002']], role_id: %q[R0001]) }.to raise_error ArgumentError, /Required arguments :user_ids missing/
|
17
17
|
end
|
18
18
|
end
|
19
19
|
context 'admin.roles_removeAssignments' do
|
20
20
|
it 'requires entity_ids' do
|
21
|
-
expect { client.admin_roles_removeAssignments(role_id: %q[], user_ids: %q[]) }.to raise_error ArgumentError, /Required arguments :entity_ids missing/
|
21
|
+
expect { client.admin_roles_removeAssignments(role_id: %q[R0001], user_ids: %q[['U00000001', 'U00000002', 'U00000003']]) }.to raise_error ArgumentError, /Required arguments :entity_ids missing/
|
22
22
|
end
|
23
23
|
it 'requires role_id' do
|
24
|
-
expect { client.admin_roles_removeAssignments(entity_ids: %q[], user_ids: %q[]) }.to raise_error ArgumentError, /Required arguments :role_id missing/
|
24
|
+
expect { client.admin_roles_removeAssignments(entity_ids: %q[['T00000001', 'E00000002']], user_ids: %q[['U00000001', 'U00000002', 'U00000003']]) }.to raise_error ArgumentError, /Required arguments :role_id missing/
|
25
25
|
end
|
26
26
|
it 'requires user_ids' do
|
27
|
-
expect { client.admin_roles_removeAssignments(entity_ids: %q[], role_id: %q[]) }.to raise_error ArgumentError, /Required arguments :user_ids missing/
|
27
|
+
expect { client.admin_roles_removeAssignments(entity_ids: %q[['T00000001', 'E00000002']], role_id: %q[R0001]) }.to raise_error ArgumentError, /Required arguments :user_ids missing/
|
28
28
|
end
|
29
29
|
end
|
30
30
|
end
|
@@ -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[]) }.to raise_error ArgumentError, /Required arguments :team_id missing/
|
42
|
+
expect { client.admin_teams_settings_setIcon(image_url: %q[http://mysite.com/icon.jpeg]) }.to raise_error ArgumentError, /Required arguments :team_id missing/
|
43
43
|
end
|
44
44
|
end
|
45
45
|
context 'admin.teams.settings_setName' do
|
@@ -7,18 +7,18 @@ RSpec.describe Slack::Web::Api::Endpoints::AdminUsergroups do
|
|
7
7
|
let(:client) { Slack::Web::Client.new }
|
8
8
|
context 'admin.usergroups_addChannels' do
|
9
9
|
it 'requires channel_ids' do
|
10
|
-
expect { client.admin_usergroups_addChannels(usergroup_id: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_ids missing/
|
10
|
+
expect { client.admin_usergroups_addChannels(usergroup_id: %q[S00000000]) }.to raise_error ArgumentError, /Required arguments :channel_ids missing/
|
11
11
|
end
|
12
12
|
it 'requires usergroup_id' do
|
13
|
-
expect { client.admin_usergroups_addChannels(channel_ids: %q[]) }.to raise_error ArgumentError, /Required arguments :usergroup_id missing/
|
13
|
+
expect { client.admin_usergroups_addChannels(channel_ids: %q[C00000000,C00000001]) }.to raise_error ArgumentError, /Required arguments :usergroup_id missing/
|
14
14
|
end
|
15
15
|
end
|
16
16
|
context 'admin.usergroups_addTeams' do
|
17
17
|
it 'requires team_ids' do
|
18
|
-
expect { client.admin_usergroups_addTeams(usergroup_id: %q[]) }.to raise_error ArgumentError, /Required arguments :team_ids missing/
|
18
|
+
expect { client.admin_usergroups_addTeams(usergroup_id: %q[S12345678]) }.to raise_error ArgumentError, /Required arguments :team_ids missing/
|
19
19
|
end
|
20
20
|
it 'requires usergroup_id' do
|
21
|
-
expect { client.admin_usergroups_addTeams(team_ids: %q[]) }.to raise_error ArgumentError, /Required arguments :usergroup_id missing/
|
21
|
+
expect { client.admin_usergroups_addTeams(team_ids: %q[T12345678,T98765432]) }.to raise_error ArgumentError, /Required arguments :usergroup_id missing/
|
22
22
|
end
|
23
23
|
end
|
24
24
|
context 'admin.usergroups_listChannels' do
|
@@ -28,10 +28,10 @@ RSpec.describe Slack::Web::Api::Endpoints::AdminUsergroups do
|
|
28
28
|
end
|
29
29
|
context 'admin.usergroups_removeChannels' do
|
30
30
|
it 'requires channel_ids' do
|
31
|
-
expect { client.admin_usergroups_removeChannels(usergroup_id: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_ids missing/
|
31
|
+
expect { client.admin_usergroups_removeChannels(usergroup_id: %q[S00000000]) }.to raise_error ArgumentError, /Required arguments :channel_ids missing/
|
32
32
|
end
|
33
33
|
it 'requires usergroup_id' do
|
34
|
-
expect { client.admin_usergroups_removeChannels(channel_ids: %q[]) }.to raise_error ArgumentError, /Required arguments :usergroup_id missing/
|
34
|
+
expect { client.admin_usergroups_removeChannels(channel_ids: %q[C00000000,C00000001]) }.to raise_error ArgumentError, /Required arguments :usergroup_id missing/
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
@@ -17,10 +17,10 @@ RSpec.describe Slack::Web::Api::Endpoints::AdminUsersSession do
|
|
17
17
|
end
|
18
18
|
context 'admin.users.session_invalidate' do
|
19
19
|
it 'requires session_id' do
|
20
|
-
expect { client.admin_users_session_invalidate(team_id: %q[]) }.to raise_error ArgumentError, /Required arguments :session_id missing/
|
20
|
+
expect { client.admin_users_session_invalidate(team_id: %q[T1234]) }.to raise_error ArgumentError, /Required arguments :session_id missing/
|
21
21
|
end
|
22
22
|
it 'requires team_id' do
|
23
|
-
expect { client.admin_users_session_invalidate(session_id: %q[]) }.to raise_error ArgumentError, /Required arguments :team_id missing/
|
23
|
+
expect { client.admin_users_session_invalidate(session_id: %q[12345]) }.to raise_error ArgumentError, /Required arguments :team_id missing/
|
24
24
|
end
|
25
25
|
end
|
26
26
|
context 'admin.users.session_reset' do
|
@@ -15,18 +15,18 @@ RSpec.describe Slack::Web::Api::Endpoints::AdminUsers do
|
|
15
15
|
end
|
16
16
|
context 'admin.users_invite' do
|
17
17
|
it 'requires channel_ids' do
|
18
|
-
expect { client.admin_users_invite(email: %q[], team_id: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_ids missing/
|
18
|
+
expect { client.admin_users_invite(email: %q[joe@email.com], team_id: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_ids missing/
|
19
19
|
end
|
20
20
|
it 'requires email' do
|
21
|
-
expect { client.admin_users_invite(channel_ids: %q[], team_id: %q[]) }.to raise_error ArgumentError, /Required arguments :email missing/
|
21
|
+
expect { client.admin_users_invite(channel_ids: %q[C1A2B3C4D,C26Z25Y24], team_id: %q[]) }.to raise_error ArgumentError, /Required arguments :email missing/
|
22
22
|
end
|
23
23
|
it 'requires team_id' do
|
24
|
-
expect { client.admin_users_invite(channel_ids: %q[], email: %q[]) }.to raise_error ArgumentError, /Required arguments :team_id missing/
|
24
|
+
expect { client.admin_users_invite(channel_ids: %q[C1A2B3C4D,C26Z25Y24], email: %q[joe@email.com]) }.to raise_error ArgumentError, /Required arguments :team_id missing/
|
25
25
|
end
|
26
26
|
end
|
27
27
|
context 'admin.users_remove' do
|
28
28
|
it 'requires team_id' do
|
29
|
-
expect { client.admin_users_remove(user_id: %q[]) }.to raise_error ArgumentError, /Required arguments :team_id missing/
|
29
|
+
expect { client.admin_users_remove(user_id: %q[W12345678]) }.to raise_error ArgumentError, /Required arguments :team_id missing/
|
30
30
|
end
|
31
31
|
it 'requires user_id' do
|
32
32
|
expect { client.admin_users_remove(team_id: %q[]) }.to raise_error ArgumentError, /Required arguments :user_id missing/
|
@@ -34,7 +34,7 @@ RSpec.describe Slack::Web::Api::Endpoints::AdminUsers do
|
|
34
34
|
end
|
35
35
|
context 'admin.users_setAdmin' do
|
36
36
|
it 'requires team_id' do
|
37
|
-
expect { client.admin_users_setAdmin(user_id: %q[]) }.to raise_error ArgumentError, /Required arguments :team_id missing/
|
37
|
+
expect { client.admin_users_setAdmin(user_id: %q[W12345678]) }.to raise_error ArgumentError, /Required arguments :team_id missing/
|
38
38
|
end
|
39
39
|
it 'requires user_id' do
|
40
40
|
expect { client.admin_users_setAdmin(team_id: %q[]) }.to raise_error ArgumentError, /Required arguments :user_id missing/
|
@@ -42,10 +42,10 @@ RSpec.describe Slack::Web::Api::Endpoints::AdminUsers do
|
|
42
42
|
end
|
43
43
|
context 'admin.users_setExpiration' do
|
44
44
|
it 'requires expiration_ts' do
|
45
|
-
expect { client.admin_users_setExpiration(user_id: %q[]) }.to raise_error ArgumentError, /Required arguments :expiration_ts missing/
|
45
|
+
expect { client.admin_users_setExpiration(user_id: %q[W12345678]) }.to raise_error ArgumentError, /Required arguments :expiration_ts missing/
|
46
46
|
end
|
47
47
|
it 'requires user_id' do
|
48
|
-
expect { client.admin_users_setExpiration(expiration_ts: %q[]) }.to raise_error ArgumentError, /Required arguments :user_id missing/
|
48
|
+
expect { client.admin_users_setExpiration(expiration_ts: %q[1234567890]) }.to raise_error ArgumentError, /Required arguments :user_id missing/
|
49
49
|
end
|
50
50
|
end
|
51
51
|
context 'admin.users_setOwner' do
|
@@ -58,7 +58,7 @@ RSpec.describe Slack::Web::Api::Endpoints::AdminUsers do
|
|
58
58
|
end
|
59
59
|
context 'admin.users_setRegular' do
|
60
60
|
it 'requires team_id' do
|
61
|
-
expect { client.admin_users_setRegular(user_id: %q[]) }.to raise_error ArgumentError, /Required arguments :team_id missing/
|
61
|
+
expect { client.admin_users_setRegular(user_id: %q[W12345678]) }.to raise_error ArgumentError, /Required arguments :team_id missing/
|
62
62
|
end
|
63
63
|
it 'requires user_id' do
|
64
64
|
expect { client.admin_users_setRegular(team_id: %q[]) }.to raise_error ArgumentError, /Required arguments :user_id missing/
|
@@ -0,0 +1,24 @@
|
|
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::AdminWorkflowsCollaborators do
|
7
|
+
let(:client) { Slack::Web::Client.new }
|
8
|
+
context 'admin.workflows.collaborators_add' do
|
9
|
+
it 'requires collaborator_ids' do
|
10
|
+
expect { client.admin_workflows_collaborators_add(workflow_ids: %q[]) }.to raise_error ArgumentError, /Required arguments :collaborator_ids missing/
|
11
|
+
end
|
12
|
+
it 'requires workflow_ids' do
|
13
|
+
expect { client.admin_workflows_collaborators_add(collaborator_ids: %q[]) }.to raise_error ArgumentError, /Required arguments :workflow_ids missing/
|
14
|
+
end
|
15
|
+
end
|
16
|
+
context 'admin.workflows.collaborators_remove' do
|
17
|
+
it 'requires collaborator_ids' do
|
18
|
+
expect { client.admin_workflows_collaborators_remove(workflow_ids: %q[]) }.to raise_error ArgumentError, /Required arguments :collaborator_ids missing/
|
19
|
+
end
|
20
|
+
it 'requires workflow_ids' do
|
21
|
+
expect { client.admin_workflows_collaborators_remove(collaborator_ids: %q[]) }.to raise_error ArgumentError, /Required arguments :workflow_ids missing/
|
22
|
+
end
|
23
|
+
end
|
24
|
+
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::AdminWorkflowsPermissions do
|
7
|
+
let(:client) { Slack::Web::Client.new }
|
8
|
+
context 'admin.workflows.permissions_lookup' do
|
9
|
+
it 'requires workflow_ids' do
|
10
|
+
expect { client.admin_workflows_permissions_lookup }.to raise_error ArgumentError, /Required arguments :workflow_ids missing/
|
11
|
+
end
|
12
|
+
end
|
13
|
+
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::AdminWorkflows do
|
7
|
+
let(:client) { Slack::Web::Client.new }
|
8
|
+
context 'admin.workflows_unpublish' do
|
9
|
+
it 'requires workflow_ids' do
|
10
|
+
expect { client.admin_workflows_unpublish }.to raise_error ArgumentError, /Required arguments :workflow_ids missing/
|
11
|
+
end
|
12
|
+
end
|
13
|
+
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::AppsActivities do
|
7
|
+
let(:client) { Slack::Web::Client.new }
|
8
|
+
context 'apps.activities_list' do
|
9
|
+
it 'requires app_id' do
|
10
|
+
expect { client.apps_activities_list }.to raise_error ArgumentError, /Required arguments :app_id missing/
|
11
|
+
end
|
12
|
+
end
|
13
|
+
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::AppsAuthExternal do
|
7
|
+
let(:client) { Slack::Web::Client.new }
|
8
|
+
context 'apps.auth.external_get' do
|
9
|
+
it 'requires external_token_id' do
|
10
|
+
expect { client.apps_auth_external_get }.to raise_error ArgumentError, /Required arguments :external_token_id missing/
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,45 @@
|
|
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::AppsDatastore do
|
7
|
+
let(:client) { Slack::Web::Client.new }
|
8
|
+
context 'apps.datastore_delete' do
|
9
|
+
it 'requires datastore' do
|
10
|
+
expect { client.apps_datastore_delete(id: %q[]) }.to raise_error ArgumentError, /Required arguments :datastore missing/
|
11
|
+
end
|
12
|
+
it 'requires id' do
|
13
|
+
expect { client.apps_datastore_delete(datastore: %q[]) }.to raise_error ArgumentError, /Required arguments :id missing/
|
14
|
+
end
|
15
|
+
end
|
16
|
+
context 'apps.datastore_get' do
|
17
|
+
it 'requires datastore' do
|
18
|
+
expect { client.apps_datastore_get(id: %q[]) }.to raise_error ArgumentError, /Required arguments :datastore missing/
|
19
|
+
end
|
20
|
+
it 'requires id' do
|
21
|
+
expect { client.apps_datastore_get(datastore: %q[]) }.to raise_error ArgumentError, /Required arguments :id missing/
|
22
|
+
end
|
23
|
+
end
|
24
|
+
context 'apps.datastore_put' do
|
25
|
+
it 'requires datastore' do
|
26
|
+
expect { client.apps_datastore_put(item: %q[]) }.to raise_error ArgumentError, /Required arguments :datastore missing/
|
27
|
+
end
|
28
|
+
it 'requires item' do
|
29
|
+
expect { client.apps_datastore_put(datastore: %q[]) }.to raise_error ArgumentError, /Required arguments :item missing/
|
30
|
+
end
|
31
|
+
end
|
32
|
+
context 'apps.datastore_query' do
|
33
|
+
it 'requires datastore' do
|
34
|
+
expect { client.apps_datastore_query }.to raise_error ArgumentError, /Required arguments :datastore missing/
|
35
|
+
end
|
36
|
+
end
|
37
|
+
context 'apps.datastore_update' do
|
38
|
+
it 'requires datastore' do
|
39
|
+
expect { client.apps_datastore_update(item: %q[]) }.to raise_error ArgumentError, /Required arguments :datastore missing/
|
40
|
+
end
|
41
|
+
it 'requires item' do
|
42
|
+
expect { client.apps_datastore_update(datastore: %q[]) }.to raise_error ArgumentError, /Required arguments :item missing/
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -9,6 +9,10 @@ RSpec.describe Slack::Web::Api::Endpoints::AppsManifest do
|
|
9
9
|
it 'requires manifest' do
|
10
10
|
expect { client.apps_manifest_create }.to raise_error ArgumentError, /Required arguments :manifest missing/
|
11
11
|
end
|
12
|
+
it 'encodes manifest as json' do
|
13
|
+
expect(client).to receive(:post).with('apps.manifest.create', {manifest: %q[{"data":["data"]}]})
|
14
|
+
client.apps_manifest_create(manifest: {:data=>["data"]})
|
15
|
+
end
|
12
16
|
end
|
13
17
|
context 'apps.manifest_delete' do
|
14
18
|
it 'requires app_id' do
|
@@ -27,6 +31,10 @@ RSpec.describe Slack::Web::Api::Endpoints::AppsManifest do
|
|
27
31
|
it 'requires manifest' do
|
28
32
|
expect { client.apps_manifest_update(app_id: %q[]) }.to raise_error ArgumentError, /Required arguments :manifest missing/
|
29
33
|
end
|
34
|
+
it 'encodes manifest as json' do
|
35
|
+
expect(client).to receive(:post).with('apps.manifest.update', {app_id: %q[], manifest: %q[{"data":["data"]}]})
|
36
|
+
client.apps_manifest_update(app_id: %q[], manifest: {:data=>["data"]})
|
37
|
+
end
|
30
38
|
end
|
31
39
|
context 'apps.manifest_validate' do
|
32
40
|
it 'requires manifest' do
|