slack-ruby-client 2.3.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +22 -12
- data/.github/workflows/update_api.yml +1 -1
- data/.gitignore +1 -0
- data/.rubocop_todo.yml +43 -13
- data/CHANGELOG.md +19 -0
- data/CONTRIBUTING.md +7 -7
- data/Gemfile +1 -0
- data/README.md +68 -25
- data/bin/commands/admin_conversations.rb +21 -0
- data/bin/commands/admin_emoji.rb +1 -1
- data/bin/commands/admin_users.rb +4 -4
- data/bin/commands/admin_users_session.rb +1 -1
- data/bin/commands/admin_workflows.rb +6 -2
- data/bin/commands/admin_workflows_triggers_types_permissions.rb +31 -0
- data/bin/commands/apps_datastore.rb +46 -0
- data/bin/commands/assistant_threads.rb +45 -0
- data/bin/commands/bookmarks.rb +1 -0
- data/bin/commands/canvases.rb +40 -0
- data/bin/commands/canvases_access.rb +34 -0
- data/bin/commands/canvases_sections.rb +21 -0
- data/bin/commands/chat.rb +7 -3
- data/bin/commands/conversations.rb +6 -6
- data/bin/commands/conversations_canvases.rb +21 -0
- data/bin/commands/conversations_externalInvitePermissions.rb +22 -0
- data/bin/commands/conversations_requestSharedInvite.rb +48 -0
- data/bin/commands/files.rb +2 -1
- data/bin/commands/functions_distributions_permissions.rb +59 -0
- data/bin/commands/oauth.rb +2 -2
- data/bin/commands/oauth_v2.rb +2 -2
- data/bin/commands/reminders.rb +1 -1
- data/bin/commands/team_externalTeams.rb +35 -0
- data/bin/commands/usergroups.rb +5 -0
- data/bin/commands/usergroups_users.rb +2 -0
- data/bin/commands/users_discoverableContacts.rb +20 -0
- data/bin/commands/workflows_triggers_permissions.rb +60 -0
- data/examples/files_upload_v2/.env.example +1 -0
- data/examples/files_upload_v2/Gemfile +5 -0
- data/examples/files_upload_v2/README.md +13 -0
- data/examples/files_upload_v2/files_upload_v2.rb +37 -0
- data/examples/oauth_v2/.env.example +4 -0
- data/examples/oauth_v2/Gemfile +7 -0
- data/examples/oauth_v2/README.md +33 -0
- data/examples/oauth_v2/oauth_v2.rb +60 -0
- data/lib/slack/messages/formatting.rb +13 -0
- data/lib/slack/version.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_conversations.rb +35 -0
- data/lib/slack/web/api/endpoints/admin_emoji.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_users.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_users_session.rb +2 -3
- data/lib/slack/web/api/endpoints/admin_workflows.rb +10 -2
- data/lib/slack/web/api/endpoints/admin_workflows_triggers_types_permissions.rb +41 -0
- data/lib/slack/web/api/endpoints/apps_datastore.rb +71 -0
- data/lib/slack/web/api/endpoints/assistant_threads.rb +68 -0
- data/lib/slack/web/api/endpoints/bookmarks.rb +2 -0
- data/lib/slack/web/api/endpoints/canvases.rb +52 -0
- data/lib/slack/web/api/endpoints/canvases_access.rb +47 -0
- data/lib/slack/web/api/endpoints/canvases_sections.rb +27 -0
- data/lib/slack/web/api/endpoints/chat.rb +12 -3
- data/lib/slack/web/api/endpoints/conversations.rb +5 -5
- data/lib/slack/web/api/endpoints/conversations_canvases.rb +26 -0
- data/lib/slack/web/api/endpoints/conversations_externalInvitePermissions.rb +31 -0
- data/lib/slack/web/api/endpoints/conversations_requestSharedInvite.rb +73 -0
- data/lib/slack/web/api/endpoints/dnd.rb +1 -0
- data/lib/slack/web/api/endpoints/files.rb +3 -1
- data/lib/slack/web/api/endpoints/functions_distributions_permissions.rb +80 -0
- data/lib/slack/web/api/endpoints/oauth.rb +2 -2
- data/lib/slack/web/api/endpoints/oauth_v2.rb +2 -2
- data/lib/slack/web/api/endpoints/reminders.rb +1 -1
- data/lib/slack/web/api/endpoints/team_externalTeams.rb +53 -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_discoverableContacts.rb +24 -0
- data/lib/slack/web/api/endpoints/workflows_triggers_permissions.rb +87 -0
- data/lib/slack/web/api/endpoints.rb +24 -0
- data/lib/slack/web/api/errors.rb +118 -8
- data/lib/slack/web/api/helpers/files.rb +87 -0
- data/lib/slack/web/api/helpers.rb +13 -0
- data/lib/slack/web/api/templates/method.erb +1 -0
- data/lib/slack/web/api/templates/method_spec.erb +6 -4
- data/lib/slack/web/client.rb +1 -0
- data/lib/slack/web/faraday/connection.rb +13 -26
- data/lib/slack/web/faraday/options.rb +24 -0
- data/lib/slack/web/faraday/request.rb +2 -1
- data/lib/slack-ruby-client.rb +2 -0
- data/slack-ruby-client.gemspec +2 -1
- metadata +52 -144
- data/screenshots/create-app.png +0 -0
- data/spec/fixtures/slack/web/429_error.yml +0 -81
- data/spec/fixtures/slack/web/auth_test_error.yml +0 -81
- data/spec/fixtures/slack/web/auth_test_success.yml +0 -81
- data/spec/fixtures/slack/web/conversations_info.yml +0 -167
- data/spec/fixtures/slack/web/conversations_setTopic.yml +0 -84
- data/spec/fixtures/slack/web/conversations_setTopic_one_page.yml +0 -172
- data/spec/fixtures/slack/web/conversations_setTopic_paginated.yml +0 -253
- data/spec/fixtures/slack/web/paginated_users_list.yml +0 -613
- data/spec/fixtures/slack/web/rtm_connect.yml +0 -391
- data/spec/fixtures/slack/web/users_info.yml +0 -214
- data/spec/fixtures/slack/web/users_list.yml +0 -133
- data/spec/fixtures/slack/web/views_open_error.yml +0 -83
- data/spec/integration/integration_spec.rb +0 -207
- data/spec/slack/config_spec.rb +0 -16
- data/spec/slack/events/config_spec.rb +0 -35
- data/spec/slack/events/request_spec.rb +0 -199
- data/spec/slack/messages/formatting_spec.rb +0 -124
- data/spec/slack/real_time/api/message_spec.rb +0 -20
- data/spec/slack/real_time/api/ping_spec.rb +0 -17
- data/spec/slack/real_time/api/typing_spec.rb +0 -19
- data/spec/slack/real_time/client_spec.rb +0 -601
- data/spec/slack/real_time/concurrency/clients/async_spec.rb +0 -16
- data/spec/slack/real_time/concurrency/it_behaves_like_a_realtime_socket.rb +0 -21
- data/spec/slack/real_time/concurrency/with_concurrency_spec.rb +0 -10
- data/spec/slack/real_time/concurrency/without_concurrency_spec.rb +0 -10
- data/spec/slack/real_time/event_handlers/bot_spec.rb +0 -47
- data/spec/slack/real_time/event_handlers/event_handlers_spec.rb +0 -16
- data/spec/slack/real_time/event_handlers/im_spec.rb +0 -51
- data/spec/slack/real_time/event_handlers/private_channel_spec.rb +0 -99
- data/spec/slack/real_time/event_handlers/public_channel_spec.rb +0 -123
- data/spec/slack/real_time/event_handlers/team_spec.rb +0 -63
- data/spec/slack/real_time/event_handlers/user_spec.rb +0 -65
- data/spec/slack/real_time/rtm_connect_spec.rb +0 -14
- data/spec/slack/real_time/stores/store_spec.rb +0 -50
- data/spec/slack/slack_spec.rb +0 -93
- data/spec/slack/version_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/admin_analytics_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/admin_apps_activities_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/admin_apps_approved_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/admin_apps_config_spec.rb +0 -18
- data/spec/slack/web/api/endpoints/admin_apps_requests_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/admin_apps_restricted_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/admin_apps_spec.rb +0 -18
- data/spec/slack/web/api/endpoints/admin_audit_anomaly_allow_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/admin_auth_policy_spec.rb +0 -35
- data/spec/slack/web/api/endpoints/admin_barriers_spec.rb +0 -38
- data/spec/slack/web/api/endpoints/admin_conversations_ekm_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/admin_conversations_restrictAccess_spec.rb +0 -32
- data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +0 -133
- data/spec/slack/web/api/endpoints/admin_emoji_spec.rb +0 -37
- data/spec/slack/web/api/endpoints/admin_functions_permissions_spec.rb +0 -21
- data/spec/slack/web/api/endpoints/admin_functions_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/admin_inviteRequests_approved_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/admin_inviteRequests_denied_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/admin_inviteRequests_spec.rb +0 -18
- data/spec/slack/web/api/endpoints/admin_roles_spec.rb +0 -30
- data/spec/slack/web/api/endpoints/admin_teams_admins_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/admin_teams_owners_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/admin_teams_settings_spec.rb +0 -53
- data/spec/slack/web/api/endpoints/admin_teams_spec.rb +0 -16
- data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +0 -37
- data/spec/slack/web/api/endpoints/admin_users_session_spec.rb +0 -41
- data/spec/slack/web/api/endpoints/admin_users_spec.rb +0 -67
- data/spec/slack/web/api/endpoints/admin_users_unsupportedVersions_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/admin_workflows_collaborators_spec.rb +0 -24
- data/spec/slack/web/api/endpoints/admin_workflows_permissions_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/admin_workflows_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/api_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/apps_activities_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/apps_auth_external_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/apps_connections_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/apps_datastore_spec.rb +0 -45
- data/spec/slack/web/api/endpoints/apps_event_authorizations_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/apps_manifest_spec.rb +0 -44
- data/spec/slack/web/api/endpoints/apps_spec.rb +0 -16
- data/spec/slack/web/api/endpoints/auth_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/auth_teams_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/bookmarks_spec.rb +0 -40
- data/spec/slack/web/api/endpoints/bots_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/calls_participants_spec.rb +0 -24
- data/spec/slack/web/api/endpoints/calls_spec.rb +0 -31
- data/spec/slack/web/api/endpoints/chat_scheduledMessages_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/chat_spec.rb +0 -134
- data/spec/slack/web/api/endpoints/conversations_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/custom_specs/auth_spec.rb +0 -27
- data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +0 -206
- data/spec/slack/web/api/endpoints/custom_specs/conversations_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb +0 -40
- data/spec/slack/web/api/endpoints/custom_specs/users_spec.rb +0 -38
- data/spec/slack/web/api/endpoints/custom_specs/views_spec.rb +0 -112
- data/spec/slack/web/api/endpoints/dialog_spec.rb +0 -14
- data/spec/slack/web/api/endpoints/dnd_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/emoji_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/files_comments_spec.rb +0 -16
- data/spec/slack/web/api/endpoints/files_remote_spec.rb +0 -24
- data/spec/slack/web/api/endpoints/files_spec.rb +0 -57
- data/spec/slack/web/api/endpoints/functions_spec.rb +0 -28
- data/spec/slack/web/api/endpoints/functions_workflows_steps_responses_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/functions_workflows_steps_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/migration_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/oauth_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/oauth_v2_spec.rb +0 -16
- data/spec/slack/web/api/endpoints/openid_connect_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/pins_spec.rb +0 -23
- data/spec/slack/web/api/endpoints/reactions_spec.rb +0 -24
- data/spec/slack/web/api/endpoints/reminders_spec.rb +0 -31
- data/spec/slack/web/api/endpoints/rtm_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/search_spec.rb +0 -23
- data/spec/slack/web/api/endpoints/stars_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/team_billing_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/team_preferences_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/team_profile_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/team_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/tooling_tokens_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/usergroups_spec.rb +0 -28
- data/spec/slack/web/api/endpoints/usergroups_users_spec.rb +0 -21
- data/spec/slack/web/api/endpoints/users_admin_spec.rb +0 -18
- data/spec/slack/web/api/endpoints/users_prefs_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/users_profile_spec.rb +0 -14
- data/spec/slack/web/api/endpoints/users_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/views_spec.rb +0 -65
- data/spec/slack/web/api/endpoints/workflows_spec.rb +0 -34
- data/spec/slack/web/api/error_spec.rb +0 -14
- data/spec/slack/web/api/errors/slack_error_spec.rb +0 -33
- data/spec/slack/web/api/mixins/conversations_list_spec.rb +0 -21
- data/spec/slack/web/api/mixins/conversations_spec.rb +0 -45
- data/spec/slack/web/api/mixins/users_spec.rb +0 -52
- data/spec/slack/web/api/options_spec.rb +0 -69
- data/spec/slack/web/api/pagination/cursor_spec.rb +0 -102
- data/spec/slack/web/client_spec.rb +0 -359
- data/spec/slack/web/faraday/request_spec.rb +0 -80
- data/spec/slack/web/faraday/response/raise_error_spec.rb +0 -86
- data/spec/spec_helper.rb +0 -30
- data/spec/support/queue_with_timeout.rb +0 -35
- data/spec/support/real_time/concurrency/mock.rb +0 -31
- data/spec/support/real_time/connected_client.rb +0 -21
- data/spec/support/real_time/event.rb +0 -12
- data/spec/support/real_time/loaded_client.rb +0 -120
- data/spec/support/token.rb +0 -11
- data/spec/support/vcr.rb +0 -45
@@ -1,67 +0,0 @@
|
|
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::AdminUsers do
|
7
|
-
let(:client) { Slack::Web::Client.new }
|
8
|
-
context 'admin.users_assign' do
|
9
|
-
it 'requires team_id' do
|
10
|
-
expect { client.admin_users_assign(user_id: %q[]) }.to raise_error ArgumentError, /Required arguments :team_id missing/
|
11
|
-
end
|
12
|
-
it 'requires user_id' do
|
13
|
-
expect { client.admin_users_assign(team_id: %q[]) }.to raise_error ArgumentError, /Required arguments :user_id missing/
|
14
|
-
end
|
15
|
-
end
|
16
|
-
context 'admin.users_invite' do
|
17
|
-
it 'requires channel_ids' do
|
18
|
-
expect { client.admin_users_invite(email: %q[joe@email.com], team_id: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_ids missing/
|
19
|
-
end
|
20
|
-
it 'requires email' do
|
21
|
-
expect { client.admin_users_invite(channel_ids: %q[C1A2B3C4D,C26Z25Y24], team_id: %q[]) }.to raise_error ArgumentError, /Required arguments :email missing/
|
22
|
-
end
|
23
|
-
it 'requires team_id' do
|
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
|
-
end
|
26
|
-
end
|
27
|
-
context 'admin.users_remove' do
|
28
|
-
it 'requires team_id' do
|
29
|
-
expect { client.admin_users_remove(user_id: %q[W12345678]) }.to raise_error ArgumentError, /Required arguments :team_id missing/
|
30
|
-
end
|
31
|
-
it 'requires user_id' do
|
32
|
-
expect { client.admin_users_remove(team_id: %q[]) }.to raise_error ArgumentError, /Required arguments :user_id missing/
|
33
|
-
end
|
34
|
-
end
|
35
|
-
context 'admin.users_setAdmin' do
|
36
|
-
it 'requires team_id' do
|
37
|
-
expect { client.admin_users_setAdmin(user_id: %q[W12345678]) }.to raise_error ArgumentError, /Required arguments :team_id missing/
|
38
|
-
end
|
39
|
-
it 'requires user_id' do
|
40
|
-
expect { client.admin_users_setAdmin(team_id: %q[]) }.to raise_error ArgumentError, /Required arguments :user_id missing/
|
41
|
-
end
|
42
|
-
end
|
43
|
-
context 'admin.users_setExpiration' do
|
44
|
-
it 'requires expiration_ts' do
|
45
|
-
expect { client.admin_users_setExpiration(user_id: %q[W12345678]) }.to raise_error ArgumentError, /Required arguments :expiration_ts missing/
|
46
|
-
end
|
47
|
-
it 'requires user_id' do
|
48
|
-
expect { client.admin_users_setExpiration(expiration_ts: %q[1234567890]) }.to raise_error ArgumentError, /Required arguments :user_id missing/
|
49
|
-
end
|
50
|
-
end
|
51
|
-
context 'admin.users_setOwner' do
|
52
|
-
it 'requires team_id' do
|
53
|
-
expect { client.admin_users_setOwner(user_id: %q[]) }.to raise_error ArgumentError, /Required arguments :team_id missing/
|
54
|
-
end
|
55
|
-
it 'requires user_id' do
|
56
|
-
expect { client.admin_users_setOwner(team_id: %q[]) }.to raise_error ArgumentError, /Required arguments :user_id missing/
|
57
|
-
end
|
58
|
-
end
|
59
|
-
context 'admin.users_setRegular' do
|
60
|
-
it 'requires team_id' do
|
61
|
-
expect { client.admin_users_setRegular(user_id: %q[W12345678]) }.to raise_error ArgumentError, /Required arguments :team_id missing/
|
62
|
-
end
|
63
|
-
it 'requires user_id' do
|
64
|
-
expect { client.admin_users_setRegular(team_id: %q[]) }.to raise_error ArgumentError, /Required arguments :user_id missing/
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
@@ -1,24 +0,0 @@
|
|
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
|
@@ -1,13 +0,0 @@
|
|
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
|
@@ -1,13 +0,0 @@
|
|
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
|
@@ -1,13 +0,0 @@
|
|
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
|
@@ -1,13 +0,0 @@
|
|
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
|
@@ -1,45 +0,0 @@
|
|
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
|
@@ -1,13 +0,0 @@
|
|
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::AppsEventAuthorizations do
|
7
|
-
let(:client) { Slack::Web::Client.new }
|
8
|
-
context 'apps.event.authorizations_list' do
|
9
|
-
it 'requires event_context' do
|
10
|
-
expect { client.apps_event_authorizations_list }.to raise_error ArgumentError, /Required arguments :event_context missing/
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
@@ -1,44 +0,0 @@
|
|
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::AppsManifest do
|
7
|
-
let(:client) { Slack::Web::Client.new }
|
8
|
-
context 'apps.manifest_create' do
|
9
|
-
it 'requires manifest' do
|
10
|
-
expect { client.apps_manifest_create }.to raise_error ArgumentError, /Required arguments :manifest missing/
|
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
|
16
|
-
end
|
17
|
-
context 'apps.manifest_delete' do
|
18
|
-
it 'requires app_id' do
|
19
|
-
expect { client.apps_manifest_delete }.to raise_error ArgumentError, /Required arguments :app_id missing/
|
20
|
-
end
|
21
|
-
end
|
22
|
-
context 'apps.manifest_export' do
|
23
|
-
it 'requires app_id' do
|
24
|
-
expect { client.apps_manifest_export }.to raise_error ArgumentError, /Required arguments :app_id missing/
|
25
|
-
end
|
26
|
-
end
|
27
|
-
context 'apps.manifest_update' do
|
28
|
-
it 'requires app_id' do
|
29
|
-
expect { client.apps_manifest_update(manifest: %q[]) }.to raise_error ArgumentError, /Required arguments :app_id missing/
|
30
|
-
end
|
31
|
-
it 'requires manifest' do
|
32
|
-
expect { client.apps_manifest_update(app_id: %q[]) }.to raise_error ArgumentError, /Required arguments :manifest missing/
|
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
|
38
|
-
end
|
39
|
-
context 'apps.manifest_validate' do
|
40
|
-
it 'requires manifest' do
|
41
|
-
expect { client.apps_manifest_validate }.to raise_error ArgumentError, /Required arguments :manifest missing/
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
@@ -1,16 +0,0 @@
|
|
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::Apps do
|
7
|
-
let(:client) { Slack::Web::Client.new }
|
8
|
-
context 'apps_uninstall' do
|
9
|
-
it 'requires client_id' do
|
10
|
-
expect { client.apps_uninstall(client_secret: %q[f25b5ceaf8a3c2a2c4f52bb4f0b0499e]) }.to raise_error ArgumentError, /Required arguments :client_id missing/
|
11
|
-
end
|
12
|
-
it 'requires client_secret' do
|
13
|
-
expect { client.apps_uninstall(client_id: %q[56579136444.26251006572]) }.to raise_error ArgumentError, /Required arguments :client_secret missing/
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
@@ -1,40 +0,0 @@
|
|
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::Bookmarks do
|
7
|
-
let(:client) { Slack::Web::Client.new }
|
8
|
-
context 'bookmarks_add' do
|
9
|
-
it 'requires channel_id' do
|
10
|
-
expect { client.bookmarks_add(title: %q[], type: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
11
|
-
end
|
12
|
-
it 'requires title' do
|
13
|
-
expect { client.bookmarks_add(channel_id: %q[C1234567890], type: %q[]) }.to raise_error ArgumentError, /Required arguments :title missing/
|
14
|
-
end
|
15
|
-
it 'requires type' do
|
16
|
-
expect { client.bookmarks_add(channel_id: %q[C1234567890], title: %q[]) }.to raise_error ArgumentError, /Required arguments :type missing/
|
17
|
-
end
|
18
|
-
end
|
19
|
-
context 'bookmarks_edit' do
|
20
|
-
it 'requires bookmark_id' do
|
21
|
-
expect { client.bookmarks_edit(channel_id: %q[C1234567890]) }.to raise_error ArgumentError, /Required arguments :bookmark_id missing/
|
22
|
-
end
|
23
|
-
it 'requires channel_id' do
|
24
|
-
expect { client.bookmarks_edit(bookmark_id: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
25
|
-
end
|
26
|
-
end
|
27
|
-
context 'bookmarks_list' do
|
28
|
-
it 'requires channel_id' do
|
29
|
-
expect { client.bookmarks_list }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
30
|
-
end
|
31
|
-
end
|
32
|
-
context 'bookmarks_remove' do
|
33
|
-
it 'requires bookmark_id' do
|
34
|
-
expect { client.bookmarks_remove(channel_id: %q[C1234567890]) }.to raise_error ArgumentError, /Required arguments :bookmark_id missing/
|
35
|
-
end
|
36
|
-
it 'requires channel_id' do
|
37
|
-
expect { client.bookmarks_remove(bookmark_id: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
@@ -1,24 +0,0 @@
|
|
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::CallsParticipants do
|
7
|
-
let(:client) { Slack::Web::Client.new }
|
8
|
-
context 'calls.participants_add' do
|
9
|
-
it 'requires id' do
|
10
|
-
expect { client.calls_participants_add(users: %q[[{"slack_id": "U1H77"}, {"external_id": "54321678", "display_name": "External User", "avatar_url": "https://example.com/users/avatar1234.jpg"}]]) }.to raise_error ArgumentError, /Required arguments :id missing/
|
11
|
-
end
|
12
|
-
it 'requires users' do
|
13
|
-
expect { client.calls_participants_add(id: %q[R0E69JAIF]) }.to raise_error ArgumentError, /Required arguments :users missing/
|
14
|
-
end
|
15
|
-
end
|
16
|
-
context 'calls.participants_remove' do
|
17
|
-
it 'requires id' do
|
18
|
-
expect { client.calls_participants_remove(users: %q[[{"slack_id": "U1H77"}, {"external_id": "54321678", "display_name": "External User", "avatar_url": "https://example.com/users/avatar1234.jpg"}]]) }.to raise_error ArgumentError, /Required arguments :id missing/
|
19
|
-
end
|
20
|
-
it 'requires users' do
|
21
|
-
expect { client.calls_participants_remove(id: %q[R0E69JAIF]) }.to raise_error ArgumentError, /Required arguments :users missing/
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,31 +0,0 @@
|
|
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::Calls do
|
7
|
-
let(:client) { Slack::Web::Client.new }
|
8
|
-
context 'calls_add' do
|
9
|
-
it 'requires external_unique_id' do
|
10
|
-
expect { client.calls_add(join_url: %q[https://example.com/calls/1234567890]) }.to raise_error ArgumentError, /Required arguments :external_unique_id missing/
|
11
|
-
end
|
12
|
-
it 'requires join_url' do
|
13
|
-
expect { client.calls_add(external_unique_id: %q[025169F6-E37A-4E62-BB54-7F93A0FC4C1F]) }.to raise_error ArgumentError, /Required arguments :join_url missing/
|
14
|
-
end
|
15
|
-
end
|
16
|
-
context 'calls_end' do
|
17
|
-
it 'requires id' do
|
18
|
-
expect { client.calls_end }.to raise_error ArgumentError, /Required arguments :id missing/
|
19
|
-
end
|
20
|
-
end
|
21
|
-
context 'calls_info' do
|
22
|
-
it 'requires id' do
|
23
|
-
expect { client.calls_info }.to raise_error ArgumentError, /Required arguments :id missing/
|
24
|
-
end
|
25
|
-
end
|
26
|
-
context 'calls_update' do
|
27
|
-
it 'requires id' do
|
28
|
-
expect { client.calls_update }.to raise_error ArgumentError, /Required arguments :id missing/
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,134 +0,0 @@
|
|
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::Chat do
|
7
|
-
let(:client) { Slack::Web::Client.new }
|
8
|
-
context 'chat_postEphemeral' do
|
9
|
-
it 'requires one of attachments, blocks, text' do
|
10
|
-
expect { client.chat_postEphemeral(channel: %q[C1234567890], user: %q[U0BPQUNTA]) }.to raise_error ArgumentError, /At least one of/
|
11
|
-
|
12
|
-
expect(client).to receive(:post).with('chat.postEphemeral', {attachments: %q[[{"pretext": "pre-hello", "text": "text-world"}]], channel: %q[C1234567890], user: %q[U0BPQUNTA]})
|
13
|
-
client.chat_postEphemeral(attachments: %q[[{"pretext": "pre-hello", "text": "text-world"}]], channel: %q[C1234567890], user: %q[U0BPQUNTA])
|
14
|
-
|
15
|
-
expect(client).to receive(:post).with('chat.postEphemeral', {blocks: %q[[{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]], channel: %q[C1234567890], user: %q[U0BPQUNTA]})
|
16
|
-
client.chat_postEphemeral(blocks: %q[[{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]], channel: %q[C1234567890], user: %q[U0BPQUNTA])
|
17
|
-
|
18
|
-
expect(client).to receive(:post).with('chat.postEphemeral', {text: %q[Hello world], channel: %q[C1234567890], user: %q[U0BPQUNTA]})
|
19
|
-
client.chat_postEphemeral(text: %q[Hello world], channel: %q[C1234567890], user: %q[U0BPQUNTA])
|
20
|
-
|
21
|
-
expect(client).to receive(:post).with('chat.postEphemeral', {attachments: %q[[{"pretext": "pre-hello", "text": "text-world"}]], blocks: %q[[{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]], channel: %q[C1234567890], user: %q[U0BPQUNTA]})
|
22
|
-
client.chat_postEphemeral(attachments: %q[[{"pretext": "pre-hello", "text": "text-world"}]], blocks: %q[[{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]], channel: %q[C1234567890], user: %q[U0BPQUNTA])
|
23
|
-
|
24
|
-
expect(client).to receive(:post).with('chat.postEphemeral', {attachments: %q[[{"pretext": "pre-hello", "text": "text-world"}]], text: %q[Hello world], channel: %q[C1234567890], user: %q[U0BPQUNTA]})
|
25
|
-
client.chat_postEphemeral(attachments: %q[[{"pretext": "pre-hello", "text": "text-world"}]], text: %q[Hello world], channel: %q[C1234567890], user: %q[U0BPQUNTA])
|
26
|
-
|
27
|
-
expect(client).to receive(:post).with('chat.postEphemeral', {blocks: %q[[{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]], text: %q[Hello world], channel: %q[C1234567890], user: %q[U0BPQUNTA]})
|
28
|
-
client.chat_postEphemeral(blocks: %q[[{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]], text: %q[Hello world], channel: %q[C1234567890], user: %q[U0BPQUNTA])
|
29
|
-
|
30
|
-
expect(client).to receive(:post).with('chat.postEphemeral', {attachments: %q[[{"pretext": "pre-hello", "text": "text-world"}]], blocks: %q[[{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]], text: %q[Hello world], channel: %q[C1234567890], user: %q[U0BPQUNTA]})
|
31
|
-
client.chat_postEphemeral(attachments: %q[[{"pretext": "pre-hello", "text": "text-world"}]], blocks: %q[[{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]], text: %q[Hello world], channel: %q[C1234567890], user: %q[U0BPQUNTA])
|
32
|
-
end
|
33
|
-
it 'encodes attachments, blocks as json' do
|
34
|
-
expect(client).to receive(:post).with('chat.postEphemeral', {channel: %q[C1234567890], user: %q[U0BPQUNTA], attachments: %q[{"data":["data"]}], blocks: %q[{"data":["data"]}]})
|
35
|
-
client.chat_postEphemeral(channel: %q[C1234567890], user: %q[U0BPQUNTA], attachments: {:data=>["data"]}, blocks: {:data=>["data"]})
|
36
|
-
end
|
37
|
-
end
|
38
|
-
context 'chat_postMessage' do
|
39
|
-
it 'requires one of attachments, blocks, text' do
|
40
|
-
expect { client.chat_postMessage(channel: %q[C1234567890]) }.to raise_error ArgumentError, /At least one of/
|
41
|
-
|
42
|
-
expect(client).to receive(:post).with('chat.postMessage', {attachments: %q[[{"pretext": "pre-hello", "text": "text-world"}]], channel: %q[C1234567890]})
|
43
|
-
client.chat_postMessage(attachments: %q[[{"pretext": "pre-hello", "text": "text-world"}]], channel: %q[C1234567890])
|
44
|
-
|
45
|
-
expect(client).to receive(:post).with('chat.postMessage', {blocks: %q[[{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]], channel: %q[C1234567890]})
|
46
|
-
client.chat_postMessage(blocks: %q[[{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]], channel: %q[C1234567890])
|
47
|
-
|
48
|
-
expect(client).to receive(:post).with('chat.postMessage', {text: %q[Hello world], channel: %q[C1234567890]})
|
49
|
-
client.chat_postMessage(text: %q[Hello world], channel: %q[C1234567890])
|
50
|
-
|
51
|
-
expect(client).to receive(:post).with('chat.postMessage', {attachments: %q[[{"pretext": "pre-hello", "text": "text-world"}]], blocks: %q[[{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]], channel: %q[C1234567890]})
|
52
|
-
client.chat_postMessage(attachments: %q[[{"pretext": "pre-hello", "text": "text-world"}]], blocks: %q[[{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]], channel: %q[C1234567890])
|
53
|
-
|
54
|
-
expect(client).to receive(:post).with('chat.postMessage', {attachments: %q[[{"pretext": "pre-hello", "text": "text-world"}]], text: %q[Hello world], channel: %q[C1234567890]})
|
55
|
-
client.chat_postMessage(attachments: %q[[{"pretext": "pre-hello", "text": "text-world"}]], text: %q[Hello world], channel: %q[C1234567890])
|
56
|
-
|
57
|
-
expect(client).to receive(:post).with('chat.postMessage', {blocks: %q[[{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]], text: %q[Hello world], channel: %q[C1234567890]})
|
58
|
-
client.chat_postMessage(blocks: %q[[{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]], text: %q[Hello world], channel: %q[C1234567890])
|
59
|
-
|
60
|
-
expect(client).to receive(:post).with('chat.postMessage', {attachments: %q[[{"pretext": "pre-hello", "text": "text-world"}]], blocks: %q[[{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]], text: %q[Hello world], channel: %q[C1234567890]})
|
61
|
-
client.chat_postMessage(attachments: %q[[{"pretext": "pre-hello", "text": "text-world"}]], blocks: %q[[{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]], text: %q[Hello world], channel: %q[C1234567890])
|
62
|
-
end
|
63
|
-
it 'encodes attachments, blocks, metadata as json' do
|
64
|
-
expect(client).to receive(:post).with('chat.postMessage', {channel: %q[C1234567890], attachments: %q[{"data":["data"]}], blocks: %q[{"data":["data"]}], metadata: %q[{"data":["data"]}]})
|
65
|
-
client.chat_postMessage(channel: %q[C1234567890], attachments: {:data=>["data"]}, blocks: {:data=>["data"]}, metadata: {:data=>["data"]})
|
66
|
-
end
|
67
|
-
end
|
68
|
-
context 'chat_scheduleMessage' do
|
69
|
-
it 'requires one of attachments, blocks, text' do
|
70
|
-
expect { client.chat_scheduleMessage(channel: %q[C1234567890], post_at: %q[299876400]) }.to raise_error ArgumentError, /At least one of/
|
71
|
-
|
72
|
-
expect(client).to receive(:post).with('chat.scheduleMessage', {attachments: %q[[{"pretext": "pre-hello", "text": "text-world"}]], channel: %q[C1234567890], post_at: %q[299876400]})
|
73
|
-
client.chat_scheduleMessage(attachments: %q[[{"pretext": "pre-hello", "text": "text-world"}]], channel: %q[C1234567890], post_at: %q[299876400])
|
74
|
-
|
75
|
-
expect(client).to receive(:post).with('chat.scheduleMessage', {blocks: %q[[{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]], channel: %q[C1234567890], post_at: %q[299876400]})
|
76
|
-
client.chat_scheduleMessage(blocks: %q[[{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]], channel: %q[C1234567890], post_at: %q[299876400])
|
77
|
-
|
78
|
-
expect(client).to receive(:post).with('chat.scheduleMessage', {text: %q[Hello world], channel: %q[C1234567890], post_at: %q[299876400]})
|
79
|
-
client.chat_scheduleMessage(text: %q[Hello world], channel: %q[C1234567890], post_at: %q[299876400])
|
80
|
-
|
81
|
-
expect(client).to receive(:post).with('chat.scheduleMessage', {attachments: %q[[{"pretext": "pre-hello", "text": "text-world"}]], blocks: %q[[{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]], channel: %q[C1234567890], post_at: %q[299876400]})
|
82
|
-
client.chat_scheduleMessage(attachments: %q[[{"pretext": "pre-hello", "text": "text-world"}]], blocks: %q[[{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]], channel: %q[C1234567890], post_at: %q[299876400])
|
83
|
-
|
84
|
-
expect(client).to receive(:post).with('chat.scheduleMessage', {attachments: %q[[{"pretext": "pre-hello", "text": "text-world"}]], text: %q[Hello world], channel: %q[C1234567890], post_at: %q[299876400]})
|
85
|
-
client.chat_scheduleMessage(attachments: %q[[{"pretext": "pre-hello", "text": "text-world"}]], text: %q[Hello world], channel: %q[C1234567890], post_at: %q[299876400])
|
86
|
-
|
87
|
-
expect(client).to receive(:post).with('chat.scheduleMessage', {blocks: %q[[{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]], text: %q[Hello world], channel: %q[C1234567890], post_at: %q[299876400]})
|
88
|
-
client.chat_scheduleMessage(blocks: %q[[{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]], text: %q[Hello world], channel: %q[C1234567890], post_at: %q[299876400])
|
89
|
-
|
90
|
-
expect(client).to receive(:post).with('chat.scheduleMessage', {attachments: %q[[{"pretext": "pre-hello", "text": "text-world"}]], blocks: %q[[{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]], text: %q[Hello world], channel: %q[C1234567890], post_at: %q[299876400]})
|
91
|
-
client.chat_scheduleMessage(attachments: %q[[{"pretext": "pre-hello", "text": "text-world"}]], blocks: %q[[{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]], text: %q[Hello world], channel: %q[C1234567890], post_at: %q[299876400])
|
92
|
-
end
|
93
|
-
it 'encodes attachments, blocks, metadata as json' do
|
94
|
-
expect(client).to receive(:post).with('chat.scheduleMessage', {channel: %q[C1234567890], post_at: %q[299876400], attachments: %q[{"data":["data"]}], blocks: %q[{"data":["data"]}], metadata: %q[{"data":["data"]}]})
|
95
|
-
client.chat_scheduleMessage(channel: %q[C1234567890], post_at: %q[299876400], attachments: {:data=>["data"]}, blocks: {:data=>["data"]}, metadata: {:data=>["data"]})
|
96
|
-
end
|
97
|
-
end
|
98
|
-
context 'chat_unfurl' do
|
99
|
-
it 'encodes unfurls, user_auth_blocks as json' do
|
100
|
-
expect(client).to receive(:post).with('chat.unfurl', {channel: %q[C1234567890], ts: %q[], unfurls: %q[{"data":["data"]}], user_auth_blocks: %q[{"data":["data"]}]})
|
101
|
-
client.chat_unfurl(channel: %q[C1234567890], ts: %q[], unfurls: {:data=>["data"]}, user_auth_blocks: {:data=>["data"]})
|
102
|
-
end
|
103
|
-
end
|
104
|
-
context 'chat_update' do
|
105
|
-
it 'requires one of attachments, blocks, text' do
|
106
|
-
expect { client.chat_update(channel: %q[C1234567890], ts: %q["1405894322.002768"]) }.to raise_error ArgumentError, /At least one of/
|
107
|
-
|
108
|
-
expect(client).to receive(:post).with('chat.update', {attachments: %q[[{"pretext": "pre-hello", "text": "text-world"}]], channel: %q[C1234567890], ts: %q["1405894322.002768"]})
|
109
|
-
client.chat_update(attachments: %q[[{"pretext": "pre-hello", "text": "text-world"}]], channel: %q[C1234567890], ts: %q["1405894322.002768"])
|
110
|
-
|
111
|
-
expect(client).to receive(:post).with('chat.update', {blocks: %q[[{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]], channel: %q[C1234567890], ts: %q["1405894322.002768"]})
|
112
|
-
client.chat_update(blocks: %q[[{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]], channel: %q[C1234567890], ts: %q["1405894322.002768"])
|
113
|
-
|
114
|
-
expect(client).to receive(:post).with('chat.update', {text: %q[Hello world], channel: %q[C1234567890], ts: %q["1405894322.002768"]})
|
115
|
-
client.chat_update(text: %q[Hello world], channel: %q[C1234567890], ts: %q["1405894322.002768"])
|
116
|
-
|
117
|
-
expect(client).to receive(:post).with('chat.update', {attachments: %q[[{"pretext": "pre-hello", "text": "text-world"}]], blocks: %q[[{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]], channel: %q[C1234567890], ts: %q["1405894322.002768"]})
|
118
|
-
client.chat_update(attachments: %q[[{"pretext": "pre-hello", "text": "text-world"}]], blocks: %q[[{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]], channel: %q[C1234567890], ts: %q["1405894322.002768"])
|
119
|
-
|
120
|
-
expect(client).to receive(:post).with('chat.update', {attachments: %q[[{"pretext": "pre-hello", "text": "text-world"}]], text: %q[Hello world], channel: %q[C1234567890], ts: %q["1405894322.002768"]})
|
121
|
-
client.chat_update(attachments: %q[[{"pretext": "pre-hello", "text": "text-world"}]], text: %q[Hello world], channel: %q[C1234567890], ts: %q["1405894322.002768"])
|
122
|
-
|
123
|
-
expect(client).to receive(:post).with('chat.update', {blocks: %q[[{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]], text: %q[Hello world], channel: %q[C1234567890], ts: %q["1405894322.002768"]})
|
124
|
-
client.chat_update(blocks: %q[[{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]], text: %q[Hello world], channel: %q[C1234567890], ts: %q["1405894322.002768"])
|
125
|
-
|
126
|
-
expect(client).to receive(:post).with('chat.update', {attachments: %q[[{"pretext": "pre-hello", "text": "text-world"}]], blocks: %q[[{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]], text: %q[Hello world], channel: %q[C1234567890], ts: %q["1405894322.002768"]})
|
127
|
-
client.chat_update(attachments: %q[[{"pretext": "pre-hello", "text": "text-world"}]], blocks: %q[[{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]], text: %q[Hello world], channel: %q[C1234567890], ts: %q["1405894322.002768"])
|
128
|
-
end
|
129
|
-
it 'encodes attachments, blocks, metadata as json' do
|
130
|
-
expect(client).to receive(:post).with('chat.update', {channel: %q[C1234567890], ts: %q["1405894322.002768"], attachments: %q[{"data":["data"]}], blocks: %q[{"data":["data"]}], metadata: %q[{"data":["data"]}]})
|
131
|
-
client.chat_update(channel: %q[C1234567890], ts: %q["1405894322.002768"], attachments: {:data=>["data"]}, blocks: {:data=>["data"]}, metadata: {:data=>["data"]})
|
132
|
-
end
|
133
|
-
end
|
134
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
require 'spec_helper'
|
3
|
-
|
4
|
-
RSpec.describe Slack::Web::Api::Endpoints::Auth do
|
5
|
-
let(:client) { Slack::Web::Client.new }
|
6
|
-
|
7
|
-
context 'without auth', vcr: { cassette_name: 'web/auth_test_error' } do
|
8
|
-
it 'fails with an exception' do
|
9
|
-
expect { client.auth_test }.to raise_error Slack::Web::Api::Errors::SlackError, 'not_authed'
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
context 'with auth', vcr: { cassette_name: 'web/auth_test_success' } do
|
14
|
-
it 'succeeds' do
|
15
|
-
expect { client.auth_test }.not_to raise_error
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
context '429 error', vcr: { cassette_name: 'web/429_error' } do
|
20
|
-
it 'fails with an specific exception' do
|
21
|
-
client.auth_test
|
22
|
-
rescue Slack::Web::Api::Errors::TooManyRequestsError => e
|
23
|
-
expect(e.message).to eq('Retry after 3600 seconds')
|
24
|
-
expect(e.retry_after).to eq(3600)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|