|
@@ -50,7 +50,7 @@ RSpec.describe 'Clearbit', aggregate_failures: true, current_user_id: 1, integra
|
|
end
|
|
end
|
|
|
|
|
|
it 'enriches the customer' do
|
|
it 'enriches the customer' do
|
|
- expect(ExternalSync).to be_exist(source: 'clearbit', object: 'User', o_id: customer.id)
|
|
|
|
|
|
+ expect(ExternalSync).to exist(source: 'clearbit', object: 'User', o_id: customer.id)
|
|
|
|
|
|
expect(customer).to have_attributes(
|
|
expect(customer).to have_attributes(
|
|
firstname: 'Should',
|
|
firstname: 'Should',
|
|
@@ -61,7 +61,7 @@ RSpec.describe 'Clearbit', aggregate_failures: true, current_user_id: 1, integra
|
|
end
|
|
end
|
|
|
|
|
|
it 'creates organization with enriched data' do
|
|
it 'creates organization with enriched data' do
|
|
- expect(ExternalSync).to be_exist(source: 'clearbit', object: 'Organization', o_id: customer.organization.id)
|
|
|
|
|
|
+ expect(ExternalSync).to exist(source: 'clearbit', object: 'Organization', o_id: customer.organization.id)
|
|
|
|
|
|
expect(customer.organization).to have_attributes(
|
|
expect(customer.organization).to have_attributes(
|
|
name: 'Uber, Inc.',
|
|
name: 'Uber, Inc.',
|
|
@@ -86,7 +86,7 @@ RSpec.describe 'Clearbit', aggregate_failures: true, current_user_id: 1, integra
|
|
let(:clearbit_config_company_bio) { 'organization.note_not_existing' }
|
|
let(:clearbit_config_company_bio) { 'organization.note_not_existing' }
|
|
|
|
|
|
it 'syncs the rest of user fields' do
|
|
it 'syncs the rest of user fields' do
|
|
- expect(ExternalSync).to be_exist(source: 'clearbit', object: 'User', o_id: customer.id)
|
|
|
|
|
|
+ expect(ExternalSync).to exist(source: 'clearbit', object: 'User', o_id: customer.id)
|
|
|
|
|
|
expect(customer).to have_attributes(
|
|
expect(customer).to have_attributes(
|
|
firstname: 'Should',
|
|
firstname: 'Should',
|
|
@@ -96,7 +96,7 @@ RSpec.describe 'Clearbit', aggregate_failures: true, current_user_id: 1, integra
|
|
end
|
|
end
|
|
|
|
|
|
it 'syncs the rest of organization fields' do
|
|
it 'syncs the rest of organization fields' do
|
|
- expect(ExternalSync).to be_exist(source: 'clearbit', object: 'Organization', o_id: customer.organization.id)
|
|
|
|
|
|
+ expect(ExternalSync).to exist(source: 'clearbit', object: 'Organization', o_id: customer.organization.id)
|
|
|
|
|
|
expect(customer.organization).to have_attributes(
|
|
expect(customer.organization).to have_attributes(
|
|
name: 'Uber, Inc.',
|
|
name: 'Uber, Inc.',
|
|
@@ -125,7 +125,7 @@ RSpec.describe 'Clearbit', aggregate_failures: true, current_user_id: 1, integra
|
|
end
|
|
end
|
|
|
|
|
|
it 'enriches the customer' do
|
|
it 'enriches the customer' do
|
|
- expect(ExternalSync).to be_exist(source: 'clearbit', object: 'User', o_id: customer.id)
|
|
|
|
|
|
+ expect(ExternalSync).to exist(source: 'clearbit', object: 'User', o_id: customer.id)
|
|
|
|
|
|
expect(customer).to have_attributes(
|
|
expect(customer).to have_attributes(
|
|
firstname: 'Martin',
|
|
firstname: 'Martin',
|
|
@@ -136,7 +136,7 @@ RSpec.describe 'Clearbit', aggregate_failures: true, current_user_id: 1, integra
|
|
end
|
|
end
|
|
|
|
|
|
it 'creates organization with enriched data' do
|
|
it 'creates organization with enriched data' do
|
|
- expect(ExternalSync).to be_exist(source: 'clearbit', object: 'Organization', o_id: customer.organization.id)
|
|
|
|
|
|
+ expect(ExternalSync).to exist(source: 'clearbit', object: 'Organization', o_id: customer.organization.id)
|
|
|
|
|
|
expect(customer.organization).to have_attributes(
|
|
expect(customer.organization).to have_attributes(
|
|
name: 'OTRS',
|
|
name: 'OTRS',
|
|
@@ -228,7 +228,7 @@ RSpec.describe 'Clearbit', aggregate_failures: true, current_user_id: 1, integra
|
|
end
|
|
end
|
|
|
|
|
|
it 'does not enrich the customer' do
|
|
it 'does not enrich the customer' do
|
|
- expect(ExternalSync).not_to be_exist(source: 'clearbit', object: 'User', o_id: customer.id)
|
|
|
|
|
|
+ expect(ExternalSync).not_to exist(source: 'clearbit', object: 'User', o_id: customer.id)
|
|
|
|
|
|
expect(customer.reload).to have_attributes(
|
|
expect(customer.reload).to have_attributes(
|
|
firstname: '',
|
|
firstname: '',
|
|
@@ -240,7 +240,7 @@ RSpec.describe 'Clearbit', aggregate_failures: true, current_user_id: 1, integra
|
|
end
|
|
end
|
|
|
|
|
|
it 'creates organization with enriched data' do
|
|
it 'creates organization with enriched data' do
|
|
- expect(ExternalSync).to be_exist(source: 'clearbit', object: 'Organization', o_id: customer.organization.id)
|
|
|
|
|
|
+ expect(ExternalSync).to exist(source: 'clearbit', object: 'Organization', o_id: customer.organization.id)
|
|
|
|
|
|
expect(customer.organization).to have_attributes(
|
|
expect(customer.organization).to have_attributes(
|
|
name: 'Znuny / ES for OTRS',
|
|
name: 'Znuny / ES for OTRS',
|
|
@@ -281,7 +281,7 @@ RSpec.describe 'Clearbit', aggregate_failures: true, current_user_id: 1, integra
|
|
it 'does not create organization with enriched data' do
|
|
it 'does not create organization with enriched data' do
|
|
expect(customer.organization).to be_present
|
|
expect(customer.organization).to be_present
|
|
|
|
|
|
- expect(Organization).not_to be_exist(name: 'ZnunyOfFred')
|
|
|
|
|
|
+ expect(Organization).not_to exist(name: 'ZnunyOfFred')
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
|
|
@@ -315,7 +315,7 @@ RSpec.describe 'Clearbit', aggregate_failures: true, current_user_id: 1, integra
|
|
end
|
|
end
|
|
|
|
|
|
it 'enriches the customer' do
|
|
it 'enriches the customer' do
|
|
- expect(ExternalSync).to be_exist(source: 'clearbit', object: 'User', o_id: customer.id)
|
|
|
|
|
|
+ expect(ExternalSync).to exist(source: 'clearbit', object: 'User', o_id: customer.id)
|
|
|
|
|
|
expect(customer).to have_attributes(
|
|
expect(customer).to have_attributes(
|
|
firstname: 'Alex',
|
|
firstname: 'Alex',
|
|
@@ -363,7 +363,7 @@ RSpec.describe 'Clearbit', aggregate_failures: true, current_user_id: 1, integra
|
|
end
|
|
end
|
|
|
|
|
|
it 'does not enrich the customer' do
|
|
it 'does not enrich the customer' do
|
|
- expect(ExternalSync).not_to be_exist(source: 'clearbit', object: 'User', o_id: customer.id)
|
|
|
|
|
|
+ expect(ExternalSync).not_to exist(source: 'clearbit', object: 'User', o_id: customer.id)
|
|
|
|
|
|
expect(customer).to have_attributes(
|
|
expect(customer).to have_attributes(
|
|
firstname: '',
|
|
firstname: '',
|
|
@@ -384,7 +384,7 @@ RSpec.describe 'Clearbit', aggregate_failures: true, current_user_id: 1, integra
|
|
end
|
|
end
|
|
|
|
|
|
it 'creates organization with enriched data' do
|
|
it 'creates organization with enriched data' do
|
|
- expect(ExternalSync).to be_exist(source: 'clearbit', object: 'Organization', o_id: customer.organization.id)
|
|
|
|
|
|
+ expect(ExternalSync).to exist(source: 'clearbit', object: 'Organization', o_id: customer.organization.id)
|
|
|
|
|
|
expect(customer.organization).to have_attributes(
|
|
expect(customer.organization).to have_attributes(
|
|
name: 'Clearbit',
|
|
name: 'Clearbit',
|
|
@@ -417,7 +417,7 @@ RSpec.describe 'Clearbit', aggregate_failures: true, current_user_id: 1, integra
|
|
end
|
|
end
|
|
|
|
|
|
it 'Limits enrichment data to database limit' do
|
|
it 'Limits enrichment data to database limit' do
|
|
- expect(ExternalSync).to be_exist(source: 'clearbit', object: 'User', o_id: customer.id)
|
|
|
|
|
|
+ expect(ExternalSync).to exist(source: 'clearbit', object: 'User', o_id: customer.id)
|
|
|
|
|
|
expect(customer.test_input).to eq 'Sm'
|
|
expect(customer.test_input).to eq 'Sm'
|
|
end
|
|
end
|