-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4277 from sanger/4178-y24-172---make_WIP_identica…
…l_in_SS_Limber add wip_list method to return wip file list
- Loading branch information
Showing
5 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 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 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
4 changes: 4 additions & 0 deletions
4
spec/data/record_loader/application_record_loader/example.wip.yml
This file contains 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Test record loader records | ||
--- | ||
Test Record: | ||
test_attribute: "A Value" |
This file contains 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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
require 'record_loader/application_record_loader' | ||
|
||
RSpec.describe RecordLoader::ApplicationRecordLoader, :loader, type: :model do | ||
def a_new_record_loader | ||
described_class.new(directory: test_directory) | ||
end | ||
|
||
subject(:record_loader) { a_new_record_loader } | ||
|
||
let(:test_directory) { Rails.root.join('spec/data/record_loader/application_record_loader') } | ||
|
||
context 'when deploy_wip_pipelines is false' do | ||
before { allow(Rails.application.config).to receive(:deploy_wip_pipelines).and_return(false) } | ||
|
||
it 'returns an empty array' do | ||
expect(record_loader.wip_list).to eq([]) | ||
end | ||
end | ||
|
||
context 'when deploy_wip_pipelines is true' do | ||
before do | ||
allow(Rails.application.config).to receive(:deploy_wip_pipelines).and_return(true) | ||
allow(Find).to receive(:find).with(test_directory).and_yield("#{test_directory}/example.wip.yml") | ||
end | ||
|
||
it 'returns a list of WIP features' do | ||
expect(record_loader.wip_list).to eq(['example']) | ||
end | ||
end | ||
|
||
context 'when deploy_wip_pipelines is not set' do | ||
before { allow(Rails.application.config).to receive(:deploy_wip_pipelines).and_return(nil) } | ||
|
||
it 'returns an empty array' do | ||
expect(record_loader.wip_list).to eq([]) | ||
end | ||
end | ||
end |