2019-10-20 10:49:12 +00:00
|
|
|
account = Account.create!(name: 'Acme Inc')
|
2019-08-14 09:48:44 +00:00
|
|
|
|
2019-10-20 10:49:12 +00:00
|
|
|
user = User.new(name: 'John', email: 'john@acme.inc', password: '123456', account: account, role: :administrator)
|
2019-08-19 08:19:57 +00:00
|
|
|
user.skip_confirmation!
|
|
|
|
user.save!
|
2019-08-14 09:48:44 +00:00
|
|
|
|
2019-10-20 10:49:12 +00:00
|
|
|
web_widget = Channel::WebWidget.create!(account: account, website_name: 'Acme', website_url: 'https://acme.inc')
|
2019-08-19 08:19:57 +00:00
|
|
|
|
2019-10-20 10:49:12 +00:00
|
|
|
inbox = Inbox.create!(channel: web_widget, account: account, name: 'Acme Support')
|
|
|
|
InboxMember.create!(user: user, inbox: inbox)
|
2019-08-19 08:19:57 +00:00
|
|
|
|
2019-11-18 03:27:41 +00:00
|
|
|
contact = Contact.create!(name: 'jane', email: 'jane@example.com', phone_number: '0000', account: account)
|
|
|
|
ContactInbox.create!(inbox: inbox, contact: contact, source_id: user.id)
|
2019-10-20 19:10:18 +00:00
|
|
|
conversation = Conversation.create!(account: account, inbox: inbox, status: :open, assignee: user, contact: contact)
|
|
|
|
Message.create!(content: 'Hello', account: account, inbox: inbox, conversation: conversation, message_type: :incoming)
|