-
Notifications
You must be signed in to change notification settings - Fork 0
Add exceptions for FTE check #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,73 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| # rubocop:disable Metrics/BlockLength | ||
| describe Config do | ||
| it 'help returns help' do | ||
| expect(Config.help).to start_with('Alma User Load Usage:') | ||
| describe '.help' do | ||
| it 'returns help' do | ||
| expect(Config.help).to start_with('Alma User Load Usage:') | ||
| end | ||
| end | ||
|
|
||
| it 'config setting for change log days is 7' do | ||
| expect(Config.setting('change_log_days')).to eq(7) | ||
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see you configured this but do you have a test to call the method with a true return and one for a false return?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call. The branch is covered..., but I don't have an explicit test for skip_fte_check (there are just tests that touch both scenarios), but probably good to have an explicit test for that purpose...I'll add that in!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added test for FTE function