0a38632f14
- Ability to configure line bots as a channel in chatwoot - Receive a message sent to the line bot in chatwoot - Ability to reply to line users from chatwoot fixes: #2738
18 lines
685 B
Ruby
18 lines
685 B
Ruby
require 'rails_helper'
|
|
|
|
describe Line::SendOnLineService do
|
|
describe '#perform' do
|
|
context 'when a valid message' do
|
|
it 'calls @channel.client.push_message' do
|
|
line_client = double
|
|
line_channel = create(:channel_line)
|
|
message = create(:message, message_type: :outgoing, content: 'test',
|
|
conversation: create(:conversation, inbox: line_channel.inbox))
|
|
allow(line_client).to receive(:push_message)
|
|
allow(Line::Bot::Client).to receive(:new).and_return(line_client)
|
|
expect(line_client).to receive(:push_message)
|
|
described_class.new(message: message).perform
|
|
end
|
|
end
|
|
end
|
|
end
|