Change sender_id to contact_id in conversations (#167)
* change sender_id to contact_id in conversations * Fix failing tests * Fix seeds * fix specs * Fix issues in facebook messenger
This commit is contained in:
@@ -16,7 +16,7 @@ FactoryBot.define do
|
||||
account: conversation.account,
|
||||
channel: create(:channel_widget, account: conversation.account)
|
||||
)
|
||||
conversation.sender ||= create(:contact, account: conversation.account)
|
||||
conversation.contact ||= create(:contact, account: conversation.account)
|
||||
conversation.assignee ||= create(:user)
|
||||
end
|
||||
end
|
||||
|
||||
23
spec/fixtures/messages.yml
vendored
23
spec/fixtures/messages.yml
vendored
@@ -1,23 +0,0 @@
|
||||
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
one:
|
||||
content: MyText
|
||||
account_id: 1
|
||||
channel_id: 1
|
||||
inbox_id: 1
|
||||
conversation_id: 1
|
||||
sender_id: 1
|
||||
sender_type: MyString
|
||||
reciever_id: 1
|
||||
reciever_type: MyString
|
||||
|
||||
two:
|
||||
content: MyText
|
||||
account_id: 1
|
||||
channel_id: 1
|
||||
inbox_id: 1
|
||||
conversation_id: 1
|
||||
sender_id: 1
|
||||
sender_type: MyString
|
||||
reciever_id: 1
|
||||
reciever_type: MyString
|
||||
@@ -79,7 +79,7 @@ RSpec.describe Conversation, type: :model do
|
||||
create(
|
||||
:conversation,
|
||||
account: account,
|
||||
sender: create(:contact, account: account),
|
||||
contact: create(:contact, account: account),
|
||||
inbox: inbox,
|
||||
assignee: nil
|
||||
)
|
||||
@@ -205,7 +205,7 @@ RSpec.describe Conversation, type: :model do
|
||||
let(:expected_data) do
|
||||
{
|
||||
meta: {
|
||||
sender: conversation.sender.push_event_data,
|
||||
sender: conversation.contact.push_event_data,
|
||||
assignee: conversation.assignee
|
||||
},
|
||||
id: conversation.display_id,
|
||||
|
||||
@@ -14,7 +14,7 @@ RSpec.describe Conversations::EventDataPresenter do
|
||||
let(:expected_data) do
|
||||
{
|
||||
meta: {
|
||||
sender: conversation.sender.push_event_data,
|
||||
sender: conversation.contact.push_event_data,
|
||||
assignee: conversation.assignee
|
||||
},
|
||||
id: conversation.display_id,
|
||||
|
||||
Reference in New Issue
Block a user