maestrano-connector-rails 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2ee22c8ca44f84ce0e4a717c80892f1765af5987
4
- data.tar.gz: 65e99c4163462829142e439f8323e8e2cd6f6306
3
+ metadata.gz: a68bf394fe0506af2d7ebf7f26fd3d03c05f3fb6
4
+ data.tar.gz: cf4b53e1b341757e263e0c12b68192fcbe187344
5
5
  SHA512:
6
- metadata.gz: 5a480181d0599bc16c945364ff6949c684eaa431f89b1c5af2f41f7f8999f451ab48a470abe680a1d854f57284fa6831bd73b3ecaf0b503a2053b34674f3a4b9
7
- data.tar.gz: 00ec463ca23d1994baaf7873ce4a26c8c3cc76c72809e5a1b06cba7ca54899f67ed5dcc92c97f019ac4fbf6363d42862edf770c579245fb42ce30ae488fbdcc5
6
+ metadata.gz: a3feb1c40cef5102c1d68ff42b988b07fe604b2b9a2f70c4a5c1a6563310915003211ada51a2e063c2219f3796be7b5fd0dae664b24217b55255733793253264
7
+ data.tar.gz: 6e0cc236c7a0e449a39611225ac8f2bf490f81556691ed5d7c26f52dab454dd7edc58fdd1aeb01206d6686d563db3b6c24189712bb0b265ca92093221da62e8d
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.0.1
@@ -176,6 +176,7 @@ module Maestrano::Connector::Rails::Concerns::Entity
176
176
  uri = "/#{self.class.normalized_connec_entity_name}?#{query_params.to_query}"
177
177
  response_hash = fetch_connec(uri, 0)
178
178
  entities = response_hash["#{self.class.normalized_connec_entity_name}"]
179
+ entities = [entities] if self.class.singleton?
179
180
 
180
181
  # Fetch subsequent pages
181
182
  while response_hash['pagination'] && response_hash['pagination']['next']
@@ -2,11 +2,11 @@
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 1.0.0 ruby lib
5
+ # stub: maestrano-connector-rails 1.0.1 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "maestrano-connector-rails"
9
- s.version = "1.0.0"
9
+ s.version = "1.0.1"
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"]
data/release_notes.md CHANGED
@@ -43,6 +43,7 @@ A major refactoring as lead to some breaking changes:
43
43
  `not_modified_since_last_push_to_connec?`
44
44
  `is_external_more_recent?`
45
45
  `solve_conflict`
46
+ * Organization.uid is now enforced as an uniq attributes
46
47
 
47
48
  * The following methods have been removed
48
49
  `map_to_external_with_idmap`
@@ -53,7 +53,7 @@ describe 'singleton workflow' do
53
53
  let(:company_base) {
54
54
  {
55
55
  "name" => "My awesome company",
56
- "updated_at" => connec_updated
56
+ "updated_at" => connec_updated.iso8601
57
57
  }
58
58
  }
59
59
 
@@ -61,7 +61,7 @@ describe 'singleton workflow' do
61
61
  {
62
62
  'id' => ext_comp_id,
63
63
  'name' => 'My not so awesome store',
64
- 'updated_at' => ext_updated
64
+ 'updated_at' => ext_updated.iso8601
65
65
  }
66
66
  }
67
67
 
@@ -99,7 +99,7 @@ describe 'singleton workflow' do
99
99
  describe 'when no idmap' do
100
100
 
101
101
  describe 'when received both' do
102
- let(:company) { [company_base.merge('id' => [{'id' => 'some connec id', 'provider' => 'connec', 'realm' => organization.uid}])] }
102
+ let(:company) { company_base.merge('id' => [{'id' => 'some connec id', 'provider' => 'connec', 'realm' => organization.uid}]) }
103
103
  let(:ext_company) { [ext_company_base] }
104
104
 
105
105
  context 'when connec most recent' do
@@ -127,6 +127,11 @@ describe 'singleton workflow' do
127
127
  }
128
128
  }
129
129
 
130
+ it 'handles the get correctly' do
131
+ expect_any_instance_of(Entities::SingletonIntegration).to receive(:consolidate_and_map_data).with([company], ext_company).and_return({connec_entities: [], external_entities: []})
132
+ subject
133
+ end
134
+
130
135
  it 'handles the idmap correctly' do
131
136
  expect{
132
137
  subject
@@ -182,7 +187,7 @@ describe 'singleton workflow' do
182
187
 
183
188
  describe 'when idmap exists' do
184
189
  describe 'when received both' do
185
- let(:company) { [company_base.merge('id' => [{'id' => ext_comp_id, 'provider' => provider, 'realm' => oauth_uid}, {'id' => 'connec-id', 'provider' => 'connec', 'realm' => 'some-realm'}])] }
190
+ let(:company) { company_base.merge('id' => [{'id' => ext_comp_id, 'provider' => provider, 'realm' => oauth_uid}, {'id' => 'connec-id', 'provider' => 'connec', 'realm' => 'some-realm'}]) }
186
191
  let(:ext_company) { [ext_company_base] }
187
192
  let!(:idmap) { Entities::SingletonIntegration.create_idmap(organization_id: organization.id, external_id: ext_comp_id) }
188
193
 
@@ -241,7 +246,7 @@ describe 'singleton workflow' do
241
246
  end
242
247
 
243
248
  describe 'when received only connec one' do
244
- let(:company) { [company_base.merge('id' => [{'id' => ext_comp_id, 'provider' => provider, 'realm' => oauth_uid}, {'id' => 'connec-id', 'provider' => 'connec', 'realm' => 'some-realm'}])] }
249
+ let(:company) { company_base.merge('id' => [{'id' => ext_comp_id, 'provider' => provider, 'realm' => oauth_uid}, {'id' => 'connec-id', 'provider' => 'connec', 'realm' => 'some-realm'}]) }
245
250
  let(:ext_company) { [] }
246
251
  let!(:idmap) { Entities::SingletonIntegration.create_idmap(organization_id: organization.id, external_id: ext_comp_id) }
247
252
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maestrano-connector-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pierre Berard