Contact model changes (#184)
* move source id from contacts * Fix contactInbox model name * rubocop fix * Fix rspec
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user