feat: Line Channel (#2904)
- 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
This commit is contained in:
18
spec/services/line/send_on_line_service_spec.rb
Normal file
18
spec/services/line/send_on_line_service_spec.rb
Normal file
@@ -0,0 +1,18 @@
|
||||
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
|
||||
Reference in New Issue
Block a user