chore: Contact builder ignores custom attributes (#3571)

This is incorrect as per the documentation here: https://www.chatwoot.com/developers/api/#operation/create-a-contact
This allows setting the proper attributes when creating a contact
This commit is contained in:
Amit Kumar
2021-12-19 10:59:03 +05:30
committed by GitHub
parent 8d65608666
commit 6069cd9eba
2 changed files with 5 additions and 2 deletions

View File

@@ -28,12 +28,14 @@ describe ::ContactBuilder do
contact_attributes: {
name: 'Contact',
phone_number: '+1234567890',
email: 'testemail@example.com'
email: 'testemail@example.com',
custom_attributes: { test: 'test' }
}
).perform
expect(contact_inbox.contact.id).not_to eq(contact.id)
expect(contact_inbox.contact.name).to eq('Contact')
expect(contact_inbox.contact.custom_attributes).to eq({ 'test' => 'test' })
expect(contact_inbox.inbox_id).to eq(inbox.id)
end