-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig_spec.rb
More file actions
73 lines (61 loc) · 1.83 KB
/
config_spec.rb
File metadata and controls
73 lines (61 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# frozen_string_literal: true
# rubocop:disable Metrics/BlockLength
describe Config do
describe '.help' do
it 'returns help' do
expect(Config.help).to start_with('Alma User Load Usage:')
end
end
describe '.setting' do
it 'returns change log days as 7' do
expect(Config.setting('change_log_days')).to eq(7)
end
end
end
describe Config do
describe '.skip_fte_check?' do
let(:job_code) { 'TEST_CODE' }
before do
allow(Config).to receive(:check_ucpath_code).and_return(false)
end
context 'when job_code is in fte_check_exclusions' do
before do
allow(Config).to receive(:check_ucpath_code)
.with('fte_check_exclusions', job_code)
.and_return(true)
end
it 'returns true' do
expect(Config.skip_fte_check?(job_code)).to be(true)
end
end
context 'when job_code is in emeritus_job_code' do
before do
allow(Config).to receive(:check_ucpath_code)
.with('emeritus_job_code', job_code)
.and_return(true)
end
it 'returns true' do
expect(Config.skip_fte_check?(job_code)).to be(true)
end
end
context 'when job_code is in neither list' do
it 'returns false' do
expect(Config.skip_fte_check?(job_code)).to be(false)
end
end
end
end
describe Config do
describe '.skip_fte_check? (with real config values)' do
it 'returns true for a job code in fte_check_exclusions' do
expect(Config.skip_fte_check?('CWR016')).to be(true)
end
it 'returns true for a job code in emeritus_job_code' do
expect(Config.skip_fte_check?('009902')).to be(true)
end
it 'returns false for a job code not in either list' do
expect(Config.skip_fte_check?('TOTALLY_FAKE_CODE')).to be(false)
end
end
end
# rubocop:enable Metrics/BlockLength