2019-08-14 09:48:44 +00:00
|
|
|
account = Account.create!([
|
2019-10-20 08:47:26 +00:00
|
|
|
{ name: 'Google' }
|
|
|
|
])
|
2019-08-14 09:48:44 +00:00
|
|
|
|
2019-10-20 08:47:26 +00:00
|
|
|
user = User.new(name: 'lary', email: 'larry@google.com', password: '123456', account_id: account.first.id)
|
2019-08-19 08:19:57 +00:00
|
|
|
user.skip_confirmation!
|
|
|
|
user.save!
|
2019-08-14 09:48:44 +00:00
|
|
|
|
2019-08-19 08:19:57 +00:00
|
|
|
channels = Channel.create!([
|
2019-10-20 08:47:26 +00:00
|
|
|
{ name: 'Facebook Messenger' }
|
|
|
|
])
|
2019-08-19 08:19:57 +00:00
|
|
|
|
|
|
|
inboxes = Inbox.create!([
|
2019-10-20 08:47:26 +00:00
|
|
|
{ channel: channels.first, account_id: 1, name: 'Google Car' },
|
|
|
|
{ channel: channels.first, account_id: 1, name: 'Project Loon' }
|
|
|
|
])
|
2019-08-19 08:19:57 +00:00
|
|
|
|
2019-08-14 09:48:44 +00:00
|
|
|
Contact.create!([
|
2019-10-20 08:47:26 +00:00
|
|
|
{ name: 'izuck@facebook.com', email: nil, phone_number: '99496030692', inbox_id: inboxes.first.id, account_id: 1 }
|
|
|
|
])
|
2019-08-14 09:48:44 +00:00
|
|
|
Conversation.create!([
|
2019-10-20 08:47:26 +00:00
|
|
|
{ account_id: 1, inbox_id: 1, status: :open, assignee_id: 1, sender_id: 1 }
|
|
|
|
])
|
2019-08-19 08:19:57 +00:00
|
|
|
|
2019-08-14 09:48:44 +00:00
|
|
|
InboxMember.create!([
|
2019-10-20 08:47:26 +00:00
|
|
|
{ user_id: 1, inbox_id: 1 }
|
|
|
|
])
|
2019-08-14 09:48:44 +00:00
|
|
|
Message.create!([
|
2019-10-20 08:47:26 +00:00
|
|
|
{ content: 'Hello', account_id: 1, inbox_id: 1, conversation_id: 1, message_type: :incoming }
|
|
|
|
])
|