Fix class methods on BizDev module
and add missing tests
This commit is contained in:
parent
38ee42d446
commit
695f5b2705
2 changed files with 43 additions and 3 deletions
40
spec/lib/biz_dev_spec.rb
Normal file
40
spec/lib/biz_dev_spec.rb
Normal file
|
@ -0,0 +1,40 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe BizDev, lib: true do
|
||||
let(:first_biz_dev_id) { BizDev::BIZ_DEV_IDS.first }
|
||||
let(:non_biz_dev_id) { first_biz_dev_id - 1 }
|
||||
|
||||
it { expect(BizDev::BIZ_DEV_MAPPING).not_to include(non_biz_dev_id) }
|
||||
|
||||
describe '#full_name' do
|
||||
subject { described_class.full_name(administration_id) }
|
||||
|
||||
context 'when administration is a business developer' do
|
||||
let(:administration_id) { first_biz_dev_id }
|
||||
|
||||
it { is_expected.not_to be_empty }
|
||||
end
|
||||
|
||||
context 'when administration is not a business developer' do
|
||||
let(:administration_id) { non_biz_dev_id }
|
||||
|
||||
it { is_expected.not_to be_empty }
|
||||
end
|
||||
end
|
||||
|
||||
describe '#pipedrive_id' do
|
||||
subject { described_class.pipedrive_id(administration_id) }
|
||||
|
||||
context 'when administration is a business developer' do
|
||||
let(:administration_id) { first_biz_dev_id }
|
||||
|
||||
it { is_expected.to be > 0 }
|
||||
end
|
||||
|
||||
context 'when administration is not a business developer' do
|
||||
let(:administration_id) { non_biz_dev_id }
|
||||
|
||||
it { is_expected.to be > 0 }
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue