Skip to content

Commit c72d4b5

Browse files
Add test for skip_fte_check?
1 parent dfa280d commit c72d4b5

1 file changed

Lines changed: 50 additions & 4 deletions

File tree

spec/lib/config_spec.rb

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,57 @@
11
# frozen_string_literal: true
22

3+
# rubocop:disable Metrics/BlockLength
34
describe Config do
4-
it 'help returns help' do
5-
expect(Config.help).to start_with('Alma User Load Usage:')
5+
describe '.help' do
6+
it 'returns help' do
7+
expect(Config.help).to start_with('Alma User Load Usage:')
8+
end
69
end
710

8-
it 'config setting for change log days is 7' do
9-
expect(Config.setting('change_log_days')).to eq(7)
11+
describe '.setting' do
12+
it 'returns change log days as 7' do
13+
expect(Config.setting('change_log_days')).to eq(7)
14+
end
1015
end
1116
end
17+
18+
describe Config do
19+
describe '.skip_fte_check?' do
20+
let(:job_code) { 'TEST_CODE' }
21+
22+
before do
23+
allow(Config).to receive(:check_ucpath_code).and_return(false)
24+
end
25+
26+
context 'when job_code is in fte_check_exclusions' do
27+
before do
28+
allow(Config).to receive(:check_ucpath_code)
29+
.with('fte_check_exclusions', job_code)
30+
.and_return(true)
31+
end
32+
33+
it 'returns true' do
34+
expect(Config.skip_fte_check?(job_code)).to be(true)
35+
end
36+
end
37+
38+
context 'when job_code is in emeritus_job_code' do
39+
before do
40+
allow(Config).to receive(:check_ucpath_code)
41+
.with('emeritus_job_code', job_code)
42+
.and_return(true)
43+
end
44+
45+
it 'returns true' do
46+
expect(Config.skip_fte_check?(job_code)).to be(true)
47+
end
48+
end
49+
50+
context 'when job_code is in neither list' do
51+
it 'returns false' do
52+
expect(Config.skip_fte_check?(job_code)).to be(false)
53+
end
54+
end
55+
end
56+
end
57+
# rubocop:enable Metrics/BlockLength

0 commit comments

Comments
 (0)