@@ -10,7 +10,7 @@ describe ::ContactMergeAction do
|
||||
before do
|
||||
2.times.each { create(:conversation, contact: base_contact) }
|
||||
2.times.each { create(:conversation, contact: mergee_contact) }
|
||||
2.times.each { create(:message, contact: mergee_contact) }
|
||||
2.times.each { create(:message, sender: mergee_contact) }
|
||||
end
|
||||
|
||||
describe '#perform' do
|
||||
|
||||
@@ -9,7 +9,7 @@ FactoryBot.define do
|
||||
account { create(:account) }
|
||||
|
||||
after(:build) do |message|
|
||||
message.user ||= create(:user, account: message.account)
|
||||
message.sender ||= create(:user, account: message.account)
|
||||
message.conversation ||= create(:conversation, account: message.account)
|
||||
message.inbox ||= create(:inbox, account: message.account)
|
||||
end
|
||||
|
||||
@@ -20,7 +20,7 @@ describe Integrations::Slack::SendOnSlackService do
|
||||
expect(slack_client).to receive(:chat_postMessage).with(
|
||||
channel: hook.reference_id,
|
||||
text: message.content,
|
||||
username: "Contact: #{contact.name}",
|
||||
username: "Agent: #{message.sender.name}",
|
||||
thread_ts: conversation.identifier,
|
||||
icon_url: anything
|
||||
)
|
||||
|
||||
@@ -254,7 +254,7 @@ RSpec.describe Conversation, type: :model do
|
||||
conversation: conversation,
|
||||
account: conversation.account,
|
||||
inbox: conversation.inbox,
|
||||
user: conversation.assignee
|
||||
sender: conversation.assignee
|
||||
}
|
||||
end
|
||||
let!(:message) do
|
||||
@@ -279,7 +279,7 @@ RSpec.describe Conversation, type: :model do
|
||||
conversation: conversation,
|
||||
account: conversation.account,
|
||||
inbox: conversation.inbox,
|
||||
user: conversation.assignee,
|
||||
sender: conversation.assignee,
|
||||
created_at: 1.minute.ago
|
||||
}
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user