chore: fix specs

This commit is contained in:
Muhsin Keloth
2024-03-18 22:44:24 +05:30
parent 3a20e8e445
commit 5e774b8d1d
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -28,7 +28,7 @@ RSpec.describe Contact do
it 'sets email to nil when empty string' do
contact = create(:contact, email: '')
expect(contact.email).to be_nil
expect(contact.contact_type).to eq('visitor')
expect(contact.contact_type).to eq('lead')
end
it 'sets custom_attributes to {} when nil' do
@@ -87,9 +87,9 @@ RSpec.describe Contact do
end
context 'when a contact is created' do
it 'has contact type "visitor" by default' do
it 'has contact type "lead" by default' do
contact = create(:contact)
expect(contact.contact_type).to eq 'visitor'
expect(contact.contact_type).to eq 'lead'
end
it 'has contact type "lead" when email is present' do
@@ -9,7 +9,7 @@ RSpec.describe Contacts::SyncAttributes do
context 'when contact has neither email/phone number nor social details' do
it 'does not change contact type' do
described_class.new(contact).perform
expect(contact.reload.contact_type).to eq('visitor')
expect(contact.reload.contact_type).to eq('lead')
end
end