Skip to content

Fix channel id typo in conversation methods #87

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix channel id typo in conversation methods
  • Loading branch information
caiopardal committed Apr 28, 2023
commit 54c6e692b4ef326eada610f6dfe69e6ebc7e5416
4 changes: 2 additions & 2 deletions lib/messagebird/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def start_conversation(to, channel_id, params = {})
:post,
'conversations/start',
params.merge(to: to,
channel_id: channel_id)
ChannelId: channel_id)
))
end

Expand Down Expand Up @@ -164,7 +164,7 @@ def conversation_webhook_create(channel_id, url, events = [])
ConversationWebhook.new(conversation_request(
:post,
'webhooks',
channel_id: channel_id,
ChannelId: channel_id,
url: url,
events: events
))
Expand Down
4 changes: 2 additions & 2 deletions spec/conversation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

expect(conversation_client)
.to receive(:request)
.with(:post, 'conversations/start', { channel_id: 'c0dae31e440145e094c4708b7d000000', to: 31_612_345_678, type: 'text', content: { text: 'Hi there!' } })
.with(:post, 'conversations/start', { ChannelId: 'c0dae31e440145e094c4708b7d000000', to: 31_612_345_678, type: 'text', content: { text: 'Hi there!' } })
.and_return('{}')

client.start_conversation(31_612_345_678, 'c0dae31e440145e094c4708b7d000000', type: 'text', content: { text: 'Hi there!' })
Expand Down Expand Up @@ -168,7 +168,7 @@

expect(conversation_client)
.to receive(:request)
.with(:post, 'webhooks', { channel_id: 'channel-id', events: [MessageBird::Conversation::WEBHOOK_EVENT_MESSAGE_CREATED, MessageBird::Conversation::WEBHOOK_EVENT_MESSAGE_UPDATED], url: 'url' })
.with(:post, 'webhooks', { ChannelId: 'channel-id', events: [MessageBird::Conversation::WEBHOOK_EVENT_MESSAGE_CREATED, MessageBird::Conversation::WEBHOOK_EVENT_MESSAGE_UPDATED], url: 'url' })
.and_return('{"id":"00000000000000000000000000000000", "events": ["message.created", "message.updated"]}')

webhook = client.conversation_webhook_create('channel-id', 'url', [MessageBird::Conversation::WEBHOOK_EVENT_MESSAGE_CREATED, MessageBird::Conversation::WEBHOOK_EVENT_MESSAGE_UPDATED])
Expand Down