maestrano-connector-rails 0.2.2 → 0.2.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a6905aef4bf750a3f64e4a18b2e51051da32531
|
4
|
+
data.tar.gz: 02839c93f8781a70219e79c1203af11108923f0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aca28e4e6f7b9a0d0f7b1c51420c69f096d0223edda6730c4f3011e3b9080abcbc0f0d878325ebb4ee0c5cbab0eba8738280d50909dccbda8752b18501753939
|
7
|
+
data.tar.gz: a9211b5615b552f6996a2300860de8348cfe58fa8dd2366ed2fcfc8aed4fdb09019782974647912370367ebff883377fd094865a7a72e07045b1f930ef4dcd9d
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.3
|
@@ -4,7 +4,7 @@ class Maestrano::ConnecController < Maestrano::Rails::WebHookController
|
|
4
4
|
Rails.logger.debug "Received notification from Connec!: #{params}"
|
5
5
|
|
6
6
|
begin
|
7
|
-
params
|
7
|
+
params.except(:tenant, :controller, :action).each do |entity_name, entities|
|
8
8
|
if entity_instance_hash = find_entity_instance(entity_name)
|
9
9
|
entity_instance = entity_instance_hash[:instance]
|
10
10
|
|
@@ -31,7 +31,7 @@ class Maestrano::ConnecController < Maestrano::Rails::WebHookController
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
else
|
34
|
-
Rails.logger.
|
34
|
+
Rails.logger.info "Received notification from Connec! for unknow entity: #{entity_name}"
|
35
35
|
end
|
36
36
|
end
|
37
37
|
rescue => e
|
@@ -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.2.
|
5
|
+
# stub: maestrano-connector-rails 0.2.3 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "maestrano-connector-rails"
|
9
|
-
s.version = "0.2.
|
9
|
+
s.version = "0.2.3"
|
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-02-
|
14
|
+
s.date = "2016-02-09"
|
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"]
|
@@ -4,10 +4,11 @@ describe Maestrano::ConnecController, type: :controller do
|
|
4
4
|
routes { Maestrano::Connector::Rails::Engine.routes }
|
5
5
|
|
6
6
|
describe 'notifications' do
|
7
|
-
let(:
|
7
|
+
let(:notifications) { {} }
|
8
8
|
let(:group_id) { 'cld_333' }
|
9
|
+
let(:params) { {tenant: 'default'}.merge(notifications) }
|
9
10
|
let(:entity) { {group_id: group_id, last_name: 'Georges', first_name: 'Teddy'} }
|
10
|
-
subject { post :notifications,
|
11
|
+
subject { post :notifications, params }
|
11
12
|
|
12
13
|
context 'without authentication' do
|
13
14
|
before {
|
@@ -31,19 +32,19 @@ describe Maestrano::ConnecController, type: :controller do
|
|
31
32
|
end
|
32
33
|
|
33
34
|
context "with an unknown entity" do
|
34
|
-
let(:
|
35
|
+
let(:notifications) { {people: [entity]} }
|
35
36
|
before {
|
36
37
|
allow(Maestrano::Connector::Rails::Entity).to receive(:entities_list).and_return(%w())
|
37
38
|
}
|
38
39
|
|
39
40
|
it 'logs a warning' do
|
40
|
-
expect(Rails.logger).to receive(:
|
41
|
+
expect(Rails.logger).to receive(:info).with('Received notification from Connec! for unknow entity: people')
|
41
42
|
subject
|
42
43
|
end
|
43
44
|
end
|
44
45
|
|
45
46
|
context "with a known complex entity" do
|
46
|
-
let(:
|
47
|
+
let(:notifications) { {lead: [entity]} }
|
47
48
|
|
48
49
|
before {
|
49
50
|
allow(Maestrano::Connector::Rails::Entity).to receive(:entities_list).and_return(%w(contact_and_lead))
|
@@ -77,7 +78,7 @@ describe Maestrano::ConnecController, type: :controller do
|
|
77
78
|
end
|
78
79
|
|
79
80
|
context "with a known non complex entity" do
|
80
|
-
let(:
|
81
|
+
let(:notifications) { {people: [entity]} }
|
81
82
|
|
82
83
|
before {
|
83
84
|
allow(Maestrano::Connector::Rails::Entity).to receive(:entities_list).and_return(%w(person))
|
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: maestrano-connector-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pierre Berard
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: maestrano-rails
|