Contact model changes (#184)

* move source id from contacts

* Fix contactInbox model name

* rubocop fix

* Fix rspec
This commit is contained in:
Sojan Jose
2019-10-27 13:14:36 +05:30
committed by GitHub
parent 3b6d58bbdf
commit c21c839dca
12 changed files with 57 additions and 20 deletions

View File

@@ -5,8 +5,6 @@ FactoryBot.define do
sequence(:name) { |n| "Widget #{n}" }
sequence(:email) { |n| "widget-#{n}@example.com" }
phone_number { '+123456789011' }
source_id { rand(100) }
account
inbox
end
end

View File

@@ -5,12 +5,10 @@ require 'rails_helper'
RSpec.describe Contact do
context 'validations' do
it { is_expected.to validate_presence_of(:account_id) }
it { is_expected.to validate_presence_of(:inbox_id) }
end
context 'associations' do
it { is_expected.to belong_to(:account) }
it { is_expected.to belong_to(:inbox) }
it { is_expected.to have_many(:conversations).dependent(:destroy) }
end