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: cb050d36d97af9d68812330c80a035c9c91fb28b
4
- data.tar.gz: ebe39a369c26144236473fc9a9da62c381c95c62
3
+ metadata.gz: 6a6905aef4bf750a3f64e4a18b2e51051da32531
4
+ data.tar.gz: 02839c93f8781a70219e79c1203af11108923f0c
5
5
  SHA512:
6
- metadata.gz: b0680266b20d2ceed8569d483d38788bd42afc935af499b1e94cfd3aa9534b066deca706d98ee60355b35321cd153cc6d30e238b3f517e2bff1ac73d4a0284ab
7
- data.tar.gz: 1bdc3afa7d0e70a3b8752d1a0ba7650074249ecd1b17d7d2cd02ebf3efdf7f836f4ce90820a995064c4d3635f7ee51b070c792e669a75fb153102a7e1c19e8db
6
+ metadata.gz: aca28e4e6f7b9a0d0f7b1c51420c69f096d0223edda6730c4f3011e3b9080abcbc0f0d878325ebb4ee0c5cbab0eba8738280d50909dccbda8752b18501753939
7
+ data.tar.gz: a9211b5615b552f6996a2300860de8348cfe58fa8dd2366ed2fcfc8aed4fdb09019782974647912370367ebff883377fd094865a7a72e07045b1f930ef4dcd9d
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.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['notification'].each do |entity_name, entities|
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.warn "Received notification from Connec! for unknow entity: #{entity_name}"
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.2 ruby lib
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.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-08"
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(:notif) { {} }
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, tenant: 'default', notification: notif }
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(:notif) { {people: [entity]} }
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(:warn).with('Received notification from Connec! for unknow entity: people')
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(:notif) { {lead: [entity]} }
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(:notif) { {people: [entity]} }
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))
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.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-08 00:00:00.000000000 Z
11
+ date: 2016-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: maestrano-rails