diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-07-04 03:08:30 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-07-04 03:08:30 +0800 |
commit | 63bf2457e40ffd465d9a5aeee9b26b1c82432f9d (patch) | |
tree | c9733e297dbf0500ffb1de8b511eb52fa9c66c45 /spec/models/project_spec.rb | |
parent | d7c32c5870ff7122122d0fc75ed8a04a0818251e (diff) | |
download | gitlab-ce-63bf2457e40ffd465d9a5aeee9b26b1c82432f9d.tar.gz |
Follow feedback on the merge request
Diffstat (limited to 'spec/models/project_spec.rb')
-rw-r--r-- | spec/models/project_spec.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 349f9c3d7eb..f06f7d6b54b 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -1493,6 +1493,30 @@ describe Project, models: true do end end + describe '#ci_config_file_for_pipeline' do + let(:project) { create(:empty_project) } + + subject { project.ci_config_file_for_pipeline } + + it 'returns the path from project' do + allow(project).to receive(:ci_config_file) { 'custom/path' } + + is_expected.to eq('custom/path') + end + + it 'returns default when custom path is nil' do + allow(project).to receive(:ci_config_file) { nil } + + is_expected.to eq('.gitlab-ci.yml') + end + + it 'returns default when custom path is empty' do + allow(project).to receive(:ci_config_file) { '' } + + is_expected.to eq('.gitlab-ci.yml') + end + end + describe '#ci_config_file=' do let(:project) { create(:empty_project) } |