maestrano-connector-rails 0.2.20 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -157
- data/VERSION +1 -1
- data/app/controllers/maestrano/connec_controller.rb +6 -6
- data/app/jobs/maestrano/connector/rails/push_to_connec_job.rb +6 -7
- data/app/jobs/maestrano/connector/rails/synchronization_job.rb +2 -0
- data/app/models/maestrano/connector/rails/concerns/complex_entity.rb +15 -15
- data/app/models/maestrano/connector/rails/concerns/entity.rb +156 -140
- data/app/models/maestrano/connector/rails/concerns/sub_entity_base.rb +54 -50
- data/lib/generators/connector/templates/complex_entity_example/contact.rb +4 -4
- data/lib/generators/connector/templates/complex_entity_example/contact_and_lead.rb +3 -3
- data/lib/generators/connector/templates/complex_entity_example/lead.rb +4 -4
- data/lib/generators/connector/templates/complex_entity_example/person.rb +4 -4
- data/lib/generators/connector/templates/entity.rb +2 -2
- data/lib/generators/connector/templates/example_entity.rb +5 -5
- data/maestrano-connector-rails.gemspec +3 -4
- data/spec/controllers/connec_controller_spec.rb +3 -3
- data/spec/jobs/push_to_connec_job_spec.rb +4 -4
- data/spec/jobs/syncrhonization_job_spec.rb +3 -1
- data/spec/models/complex_entity_spec.rb +25 -24
- data/spec/models/entity_spec.rb +123 -103
- data/spec/models/sub_entity_base_spec.rb +92 -86
- data/template/maestrano-connector-template.rb +4 -3
- metadata +2 -3
- data/lib/generators/connector/templates/contact_and_lead.rb +0 -55
@@ -1,70 +1,74 @@
|
|
1
1
|
module Maestrano::Connector::Rails::Concerns::SubEntityBase
|
2
2
|
extend ActiveSupport::Concern
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
module ClassMethods
|
5
|
+
def external?
|
6
|
+
raise "Not implemented"
|
7
|
+
end
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
|
9
|
+
def entity_name
|
10
|
+
raise "Not implemented"
|
11
|
+
end
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
13
|
+
def external_entity_name
|
14
|
+
if external?
|
15
|
+
entity_name
|
16
|
+
else
|
17
|
+
raise "Forbidden call: cannot call external_entity_name for a connec entity"
|
18
|
+
end
|
19
|
+
end
|
15
20
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
+
def connec_entity_name
|
22
|
+
if external?
|
23
|
+
raise "Forbidden call: cannot call connec_entity_name for an external entity"
|
24
|
+
else
|
25
|
+
entity_name
|
26
|
+
end
|
21
27
|
end
|
22
|
-
end
|
23
28
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
+
def names_hash
|
30
|
+
if external?
|
31
|
+
{external_entity: entity_name.downcase}
|
32
|
+
else
|
33
|
+
{connec_entity: entity_name.downcase}
|
34
|
+
end
|
29
35
|
end
|
30
|
-
end
|
31
36
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
+
def create_idmap_from_external_entity(entity, connec_entity_name, organization)
|
38
|
+
if external?
|
39
|
+
h = names_hash.merge({
|
40
|
+
external_id: id_from_external_entity_hash(entity),
|
41
|
+
name: object_name_from_external_entity_hash(entity),
|
42
|
+
connec_entity: connec_entity_name.downcase,
|
43
|
+
organization_id: organization.id
|
44
|
+
})
|
45
|
+
Maestrano::Connector::Rails::IdMap.create(h)
|
46
|
+
else
|
47
|
+
raise 'Forbidden call: cannot call create_idmap_from_external_entity for a connec entity'
|
48
|
+
end
|
37
49
|
end
|
38
|
-
end
|
39
50
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
+
def create_idmap_from_connec_entity(entity, external_entity_name, organization)
|
52
|
+
if external?
|
53
|
+
raise 'Forbidden call: cannot call create_idmap_from_connec_entity for an external entity'
|
54
|
+
else
|
55
|
+
h = names_hash.merge({
|
56
|
+
connec_id: entity['id'],
|
57
|
+
name: object_name_from_connec_entity_hash(entity),
|
58
|
+
external_entity: external_entity_name.downcase,
|
59
|
+
organization_id: organization.id
|
60
|
+
})
|
61
|
+
Maestrano::Connector::Rails::IdMap.create(h)
|
62
|
+
end
|
51
63
|
end
|
52
64
|
end
|
53
65
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
else
|
58
|
-
h = names_hash.merge({
|
59
|
-
connec_id: entity['id'],
|
60
|
-
name: object_name_from_connec_entity_hash(entity),
|
61
|
-
external_entity: external_entity_name.downcase,
|
62
|
-
organization_id: organization.id
|
63
|
-
})
|
64
|
-
Maestrano::Connector::Rails::IdMap.create(h)
|
65
|
-
end
|
66
|
+
|
67
|
+
def map_to(name, entity, organization)
|
68
|
+
raise "Not implemented"
|
66
69
|
end
|
67
70
|
|
71
|
+
|
68
72
|
def map_external_entity_with_idmap(external_entity, connec_entity_name, idmap, organization)
|
69
73
|
{entity: map_to(connec_entity_name, external_entity, organization), idmap: idmap}
|
70
74
|
end
|
@@ -3,11 +3,11 @@
|
|
3
3
|
# See README for explanation
|
4
4
|
# class Entities::SubEntities::Contact < Maestrano::Connector::Rails::SubEntityBase
|
5
5
|
|
6
|
-
# def external?
|
6
|
+
# def self.external?
|
7
7
|
# true
|
8
8
|
# end
|
9
9
|
|
10
|
-
# def entity_name
|
10
|
+
# def self.entity_name
|
11
11
|
# 'contact'
|
12
12
|
# end
|
13
13
|
|
@@ -20,11 +20,11 @@
|
|
20
20
|
# end
|
21
21
|
# end
|
22
22
|
|
23
|
-
# def object_name_from_connec_entity_hash(entity)
|
23
|
+
# def self.object_name_from_connec_entity_hash(entity)
|
24
24
|
# "#{entity['first_name']} #{entity['last_name']}"
|
25
25
|
# end
|
26
26
|
|
27
|
-
# def object_name_from_external_entity_hash(entity)
|
27
|
+
# def self.object_name_from_external_entity_hash(entity)
|
28
28
|
# "#{entity['FirstName']} #{entity['LastName']}"
|
29
29
|
# end
|
30
30
|
# end
|
@@ -2,13 +2,13 @@
|
|
2
2
|
# This file is provided as an example and should be removed
|
3
3
|
# See README for explanation
|
4
4
|
# class Entities::ContactAndLead < Maestrano::Connector::Rails::ComplexEntity
|
5
|
-
# def connec_entities_names
|
5
|
+
# def self.connec_entities_names
|
6
6
|
# %w(person)
|
7
7
|
# end
|
8
8
|
|
9
|
-
# def external_entities_names
|
9
|
+
# def self.external_entities_names
|
10
10
|
# %w(contact lead)
|
11
|
-
#
|
11
|
+
# endCont
|
12
12
|
|
13
13
|
# # input : {
|
14
14
|
# # connec_entity_names[0]: [unmapped_connec_entitiy1, unmapped_connec_entitiy2],
|
@@ -3,11 +3,11 @@
|
|
3
3
|
# See README for explanation
|
4
4
|
# class Entities::SubEntities::Lead < Maestrano::Connector::Rails::SubEntityBase
|
5
5
|
|
6
|
-
# def external?
|
6
|
+
# def self.external?
|
7
7
|
# true
|
8
8
|
# end
|
9
9
|
|
10
|
-
# def entity_name
|
10
|
+
# def self.entity_name
|
11
11
|
# 'lead'
|
12
12
|
# end
|
13
13
|
|
@@ -20,11 +20,11 @@
|
|
20
20
|
# end
|
21
21
|
# end
|
22
22
|
|
23
|
-
# def object_name_from_connec_entity_hash(entity)
|
23
|
+
# def self.object_name_from_connec_entity_hash(entity)
|
24
24
|
# "#{entity['first_name']} #{entity['last_name']}"
|
25
25
|
# end
|
26
26
|
|
27
|
-
# def object_name_from_external_entity_hash(entity)
|
27
|
+
# def self.object_name_from_external_entity_hash(entity)
|
28
28
|
# "#{entity['FirstName']} #{entity['LastName']}"
|
29
29
|
# end
|
30
30
|
# end
|
@@ -2,11 +2,11 @@
|
|
2
2
|
# This file is provided as an example and should be removed
|
3
3
|
# See README for explanation
|
4
4
|
# class Enities::SubEntities::Person < Maestrano::Connector::Rails::SubEntityBase
|
5
|
-
# def external?
|
5
|
+
# def self.external?
|
6
6
|
# false
|
7
7
|
# end
|
8
8
|
|
9
|
-
# def entity_name
|
9
|
+
# def self.entity_name
|
10
10
|
# 'person'
|
11
11
|
# end
|
12
12
|
|
@@ -21,11 +21,11 @@
|
|
21
21
|
# end
|
22
22
|
# end
|
23
23
|
|
24
|
-
# def object_name_from_connec_entity_hash(entity)
|
24
|
+
# def self.object_name_from_connec_entity_hash(entity)
|
25
25
|
# "#{entity['first_name']} #{entity['last_name']}"
|
26
26
|
# end
|
27
27
|
|
28
|
-
# def object_name_from_external_entity_hash(entity)
|
28
|
+
# def self.object_name_from_external_entity_hash(entity)
|
29
29
|
# "#{entity['FirstName']} #{entity['LastName']}"
|
30
30
|
# end
|
31
31
|
# end
|
@@ -33,13 +33,13 @@ class Maestrano::Connector::Rails::Entity
|
|
33
33
|
# This method updates the entity with the given id in the external app
|
34
34
|
end
|
35
35
|
|
36
|
-
def
|
36
|
+
def self.id_from_external_entity_hash(entity)
|
37
37
|
# TODO
|
38
38
|
# This method return the id from an external_entity_hash
|
39
39
|
# e.g entity['id']
|
40
40
|
end
|
41
41
|
|
42
|
-
def
|
42
|
+
def self.last_update_date_from_external_entity_hash(entity)
|
43
43
|
# TODO
|
44
44
|
# This method return the last update date from an external_entity_hash
|
45
45
|
# e.g entity['last_update']
|
@@ -4,23 +4,23 @@
|
|
4
4
|
# with its associated mapper
|
5
5
|
|
6
6
|
# class Entities::ExampleEntity < Maestrano::Connector::Rails::Entity
|
7
|
-
# def connec_entity_name
|
7
|
+
# def self.connec_entity_name
|
8
8
|
# 'ExampleEntity'
|
9
9
|
# end
|
10
10
|
|
11
|
-
# def external_entity_name
|
11
|
+
# def self.external_entity_name
|
12
12
|
# 'Contact'
|
13
13
|
# end
|
14
14
|
|
15
|
-
# def mapper_class
|
15
|
+
# def self.mapper_class
|
16
16
|
# ExampleEntityMapper
|
17
17
|
# end
|
18
18
|
|
19
|
-
# def object_name_from_connec_entity_hash(entity)
|
19
|
+
# def self.object_name_from_connec_entity_hash(entity)
|
20
20
|
# "#{entity['first_name']} #{entity['last_name']}"
|
21
21
|
# end
|
22
22
|
|
23
|
-
# def object_name_from_external_entity_hash(entity)
|
23
|
+
# def self.object_name_from_external_entity_hash(entity)
|
24
24
|
# "#{entity['FirstName']} #{entity['LastName']}"
|
25
25
|
# end
|
26
26
|
|
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: maestrano-connector-rails 0.
|
5
|
+
# stub: maestrano-connector-rails 0.3.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "maestrano-connector-rails"
|
9
|
-
s.version = "0.
|
9
|
+
s.version = "0.3.0"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Pierre Berard"]
|
14
|
-
s.date = "2016-03-
|
14
|
+
s.date = "2016-03-18"
|
15
15
|
s.description = "Maestrano is the next generation marketplace for SME applications. See https://maestrano.com for details."
|
16
16
|
s.email = "pierre.berard@maestrano.com"
|
17
17
|
s.executables = ["rails"]
|
@@ -71,7 +71,6 @@ Gem::Specification.new do |s|
|
|
71
71
|
"lib/generators/connector/templates/complex_entity_example/lead.rb",
|
72
72
|
"lib/generators/connector/templates/complex_entity_example/lead_mapper.rb",
|
73
73
|
"lib/generators/connector/templates/complex_entity_example/person.rb",
|
74
|
-
"lib/generators/connector/templates/contact_and_lead.rb",
|
75
74
|
"lib/generators/connector/templates/entity.rb",
|
76
75
|
"lib/generators/connector/templates/example_entity.rb",
|
77
76
|
"lib/generators/connector/templates/external.rb",
|
@@ -49,7 +49,7 @@ describe Maestrano::ConnecController, type: :controller do
|
|
49
49
|
before {
|
50
50
|
allow(Maestrano::Connector::Rails::Entity).to receive(:entities_list).and_return(%w(contact_and_lead))
|
51
51
|
class Entities::ContactAndLead < Maestrano::Connector::Rails::ComplexEntity
|
52
|
-
def connec_entities_names
|
52
|
+
def self.connec_entities_names
|
53
53
|
%w(Lead)
|
54
54
|
end
|
55
55
|
end
|
@@ -65,7 +65,7 @@ describe Maestrano::ConnecController, type: :controller do
|
|
65
65
|
|
66
66
|
context 'when syncing' do
|
67
67
|
before {
|
68
|
-
|
68
|
+
allow(Entities::ContactAndLead).to receive(:external_entities_names).and_return(%w())
|
69
69
|
}
|
70
70
|
let!(:organization) { create(:organization, uid: group_id, oauth_uid: 'lala', sync_enabled: true, synchronized_entities: {contact_and_lead: true}) }
|
71
71
|
|
@@ -83,7 +83,7 @@ describe Maestrano::ConnecController, type: :controller do
|
|
83
83
|
before {
|
84
84
|
allow(Maestrano::Connector::Rails::Entity).to receive(:entities_list).and_return(%w(person))
|
85
85
|
class Entities::Person < Maestrano::Connector::Rails::Entity
|
86
|
-
def connec_entity_name
|
86
|
+
def self.connec_entity_name
|
87
87
|
'People'
|
88
88
|
end
|
89
89
|
end
|
@@ -11,18 +11,18 @@ describe Maestrano::Connector::Rails::PushToConnecJob do
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
allow_any_instance_of(Entities::Entity1).to receive(:push_entities_to_connec)
|
14
|
-
|
14
|
+
allow(Entities::Entity1).to receive(:external_entity_name).and_return('ext_entity1')
|
15
15
|
class Entities::Entity2 < Maestrano::Connector::Rails::ComplexEntity
|
16
16
|
end
|
17
17
|
allow_any_instance_of(Entities::Entity2).to receive(:consolidate_and_map_data).and_return({})
|
18
18
|
allow_any_instance_of(Entities::Entity2).to receive(:push_entities_to_connec)
|
19
|
-
|
20
|
-
|
19
|
+
allow(Entities::Entity2).to receive(:connec_entities_names).and_return(%w())
|
20
|
+
allow(Entities::Entity2).to receive(:external_entities_names).and_return(%w(Subs ll))
|
21
21
|
module Entities::SubEntities end;
|
22
22
|
class Entities::SubEntities::Sub < Maestrano::Connector::Rails::SubEntityBase
|
23
23
|
end
|
24
24
|
allow(Maestrano::Connector::Rails::Entity).to receive(:entities_list).and_return([entity_name1, entity_name2])
|
25
|
-
|
25
|
+
allow(Maestrano::Connector::Rails::Entity).to receive(:id_from_external_entity_hash).and_return('11')
|
26
26
|
}
|
27
27
|
let(:entity11) { {first_name: 'John'} }
|
28
28
|
let(:entity12) { {first_name: 'Jane'} }
|
@@ -57,12 +57,14 @@ describe Maestrano::Connector::Rails::SynchronizationJob do
|
|
57
57
|
|
58
58
|
subject { Maestrano::Connector::Rails::SynchronizationJob.new }
|
59
59
|
|
60
|
-
it 'calls the
|
60
|
+
it 'calls the seven methods' do
|
61
|
+
expect_any_instance_of(Entities::Person).to receive(:before_sync)
|
61
62
|
expect_any_instance_of(Entities::Person).to receive(:get_connec_entities)
|
62
63
|
expect_any_instance_of(Entities::Person).to receive(:get_external_entities)
|
63
64
|
expect_any_instance_of(Entities::Person).to receive(:consolidate_and_map_data).and_return({})
|
64
65
|
expect_any_instance_of(Entities::Person).to receive(:push_entities_to_external)
|
65
66
|
expect_any_instance_of(Entities::Person).to receive(:push_entities_to_connec)
|
67
|
+
expect_any_instance_of(Entities::Person).to receive(:after_sync)
|
66
68
|
subject.sync_entity('person', organization, nil, nil, nil, {})
|
67
69
|
end
|
68
70
|
end
|
@@ -2,13 +2,15 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Maestrano::Connector::Rails::ComplexEntity do
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
subject { Maestrano::Connector::Rails::ComplexEntity.new }
|
6
|
+
|
7
|
+
#Complex specific methods
|
8
|
+
describe 'complex specific methods' do
|
7
9
|
describe 'connec_entities_names' do
|
8
|
-
it { expect{ subject.connec_entities_names }.to raise_error('Not implemented') }
|
10
|
+
it { expect{ subject.class.connec_entities_names }.to raise_error('Not implemented') }
|
9
11
|
end
|
10
12
|
describe 'external_entities_names' do
|
11
|
-
it { expect{ subject.external_entities_names }.to raise_error('Not implemented') }
|
13
|
+
it { expect{ subject.class.external_entities_names }.to raise_error('Not implemented') }
|
12
14
|
end
|
13
15
|
describe 'connec_model_to_external_model' do
|
14
16
|
it { expect{ subject.connec_model_to_external_model({}) }.to raise_error('Not implemented') }
|
@@ -19,7 +21,6 @@ describe Maestrano::Connector::Rails::ComplexEntity do
|
|
19
21
|
end
|
20
22
|
|
21
23
|
describe 'general methods' do
|
22
|
-
subject { Maestrano::Connector::Rails::ComplexEntity.new }
|
23
24
|
|
24
25
|
describe 'map_to_external_with_idmap' do
|
25
26
|
let(:organization) { create(:organization) }
|
@@ -31,10 +32,10 @@ describe Maestrano::Connector::Rails::ComplexEntity do
|
|
31
32
|
let(:sub_instance) { Maestrano::Connector::Rails::SubEntityBase.new }
|
32
33
|
let(:human_name) { 'ET' }
|
33
34
|
before {
|
34
|
-
allow(sub_instance).to receive(:external?).and_return(false)
|
35
|
-
allow(sub_instance).to receive(:entity_name).and_return(connec_name)
|
35
|
+
allow(sub_instance.class).to receive(:external?).and_return(false)
|
36
|
+
allow(sub_instance.class).to receive(:entity_name).and_return(connec_name)
|
36
37
|
allow(sub_instance).to receive(:map_to).and_return(mapped_entity)
|
37
|
-
allow(sub_instance).to receive(:object_name_from_connec_entity_hash).and_return(human_name)
|
38
|
+
allow(sub_instance.class).to receive(:object_name_from_connec_entity_hash).and_return(human_name)
|
38
39
|
}
|
39
40
|
|
40
41
|
context 'when entity has no idmap' do
|
@@ -188,20 +189,20 @@ describe Maestrano::Connector::Rails::ComplexEntity do
|
|
188
189
|
before{
|
189
190
|
allow(subject).to receive(:external_model_to_connec_model).and_return(external_hash)
|
190
191
|
allow(subject).to receive(:connec_model_to_external_model).and_return(connec_hash)
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
192
|
+
allow(Entities::SubEntities::ScE1).to receive(:external?).and_return(true)
|
193
|
+
allow(Entities::SubEntities::ScE1).to receive(:entity_name).and_return('sc_e1')
|
194
|
+
allow(Entities::SubEntities::ScE1).to receive(:id_from_external_entity_hash).with(entity1).and_return(id1)
|
195
|
+
allow(Entities::SubEntities::ScE1).to receive(:last_update_date_from_external_entity_hash).and_return(1.minute.ago)
|
195
196
|
allow_any_instance_of(Entities::SubEntities::ScE1).to receive(:map_to).with('connec1', entity1, organization).and_return(mapped_entity1)
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
197
|
+
allow(Entities::SubEntities::ScE2).to receive(:external?).and_return(true)
|
198
|
+
allow(Entities::SubEntities::ScE2).to receive(:entity_name).and_return('Sce2')
|
199
|
+
allow(Entities::SubEntities::ScE2).to receive(:id_from_external_entity_hash).with(entity1).and_return(id1)
|
200
|
+
allow(Entities::SubEntities::ScE2).to receive(:id_from_external_entity_hash).with(entity2).and_return(id2)
|
201
|
+
allow(Entities::SubEntities::ScE2).to receive(:last_update_date_from_external_entity_hash).and_return(1.minute.ago)
|
201
202
|
allow_any_instance_of(Entities::SubEntities::ScE2).to receive(:map_to).with('connec1', entity1, organization).and_return(mapped_entity1)
|
202
203
|
allow_any_instance_of(Entities::SubEntities::ScE2).to receive(:map_to).with('connec2', entity2, organization).and_return(mapped_entity2)
|
203
|
-
|
204
|
-
|
204
|
+
allow(Entities::SubEntities::ScE1).to receive(:object_name_from_external_entity_hash).and_return(human_name)
|
205
|
+
allow(Entities::SubEntities::ScE2).to receive(:object_name_from_external_entity_hash).and_return(human_name)
|
205
206
|
}
|
206
207
|
|
207
208
|
context 'when entities have no idmaps' do
|
@@ -268,9 +269,9 @@ describe Maestrano::Connector::Rails::ComplexEntity do
|
|
268
269
|
class Entities::SubEntities::Connec2 < Maestrano::Connector::Rails::SubEntityBase
|
269
270
|
end
|
270
271
|
allow_any_instance_of(Entities::SubEntities::Connec1).to receive(:map_to).and_return({'name' => 'Jacob'})
|
271
|
-
|
272
|
-
|
273
|
-
|
272
|
+
allow(Entities::SubEntities::Connec1).to receive(:external?).and_return(false)
|
273
|
+
allow(Entities::SubEntities::Connec1).to receive(:entity_name).and_return('connec1')
|
274
|
+
allow(Entities::SubEntities::Connec1).to receive(:object_name_from_connec_entity_hash).and_return('human name')
|
274
275
|
}
|
275
276
|
let(:connec_id1) { '67ttf-5rr4d' }
|
276
277
|
let!(:idmap1) { create(:idmap, organization: organization, external_id: id1, external_entity: 'sc_e1', connec_entity: 'connec1', last_push_to_connec: 1.year.ago, connec_id: connec_id1) }
|
@@ -384,8 +385,8 @@ describe Maestrano::Connector::Rails::ComplexEntity do
|
|
384
385
|
let(:idmap) { create(:idmap, organization: organization) }
|
385
386
|
before {
|
386
387
|
[Entities::SubEntities::ScE1, Entities::SubEntities::ScE2].each do |klass|
|
387
|
-
|
388
|
-
|
388
|
+
allow(klass).to receive(:external?).and_return(true)
|
389
|
+
allow(klass).to receive(:entity_name).and_return('n')
|
389
390
|
end
|
390
391
|
allow(client).to receive(:put).and_return(ActionDispatch::Response.new(200, {}, {people: {}}.to_json, {}))
|
391
392
|
}
|