move to only one pipedrive account
This commit is contained in:
parent
3857e88648
commit
4032fc61e3
3 changed files with 7 additions and 33 deletions
|
@ -1,38 +1,12 @@
|
||||||
module BizDev
|
module BizDev
|
||||||
BIZ_DEV_MAPPING = {
|
NAME = "Équipe DS"
|
||||||
9 =>
|
PIPEDRIVE_ID = 6019737
|
||||||
{
|
|
||||||
full_name: "Philippe Vrignaud",
|
|
||||||
pipedrive_id: 2753338
|
|
||||||
},
|
|
||||||
10 =>
|
|
||||||
{
|
|
||||||
full_name: "Benjamin Doberset",
|
|
||||||
pipedrive_id: 4223834
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
BIZ_DEV_IDS = BIZ_DEV_MAPPING.keys
|
|
||||||
|
|
||||||
def self.full_name(administration_id)
|
def self.full_name(administration_id)
|
||||||
id = ensure_proper_administration_id(administration_id)
|
NAME
|
||||||
|
|
||||||
BIZ_DEV_MAPPING[id][:full_name]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.pipedrive_id(administration_id)
|
def self.pipedrive_id(administration_id)
|
||||||
id = ensure_proper_administration_id(administration_id)
|
PIPEDRIVE_ID
|
||||||
|
|
||||||
BIZ_DEV_MAPPING[id][:pipedrive_id]
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def self.ensure_proper_administration_id(administration_id)
|
|
||||||
if administration_id.in?(BIZ_DEV_IDS)
|
|
||||||
administration_id
|
|
||||||
else
|
|
||||||
BIZ_DEV_IDS[administration_id % BIZ_DEV_IDS.length]
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe BizDev, lib: true do
|
describe BizDev, lib: true do
|
||||||
let(:first_biz_dev_id) { BizDev::BIZ_DEV_IDS.first }
|
let(:first_biz_dev_id) { BizDev::PIPEDRIVE_ID }
|
||||||
let(:non_biz_dev_id) { first_biz_dev_id - 1 }
|
let(:non_biz_dev_id) { first_biz_dev_id - 1 }
|
||||||
|
|
||||||
it { expect(BizDev::BIZ_DEV_MAPPING).not_to include(non_biz_dev_id) }
|
it { expect(BizDev::PIPEDRIVE_ID).not_to eq(non_biz_dev_id) }
|
||||||
|
|
||||||
describe '#full_name' do
|
describe '#full_name' do
|
||||||
subject { described_class.full_name(administration_id) }
|
subject { described_class.full_name(administration_id) }
|
||||||
|
|
|
@ -11,7 +11,7 @@ RSpec.describe AdministrationMailer, type: :mailer do
|
||||||
describe '#invite_admin' do
|
describe '#invite_admin' do
|
||||||
let(:admin) { create(:administrateur) }
|
let(:admin) { create(:administrateur) }
|
||||||
let(:token) { "Toc toc toc" }
|
let(:token) { "Toc toc toc" }
|
||||||
let(:administration_id) { BizDev::BIZ_DEV_IDS.first }
|
let(:administration_id) { BizDev::PIPEDRIVE_ID }
|
||||||
|
|
||||||
subject { described_class.invite_admin(admin, token, administration_id) }
|
subject { described_class.invite_admin(admin, token, administration_id) }
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue