diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-07-05 20:11:01 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-07-05 20:11:01 +0800 |
commit | 9f5ac179d1ca4819006c66ae385ba7153f6c7e4f (patch) | |
tree | 8dafab8a2f87092dd57c26fbbb70b131d98d9078 /spec | |
parent | 9f7e5e45df9b7d99b97e40d1c08250925a408875 (diff) | |
download | gitlab-ce-9f5ac179d1ca4819006c66ae385ba7153f6c7e4f.tar.gz |
Rename ci_config_file to ci_config_path
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/import_export/safe_model_attributes.yml | 2 | ||||
-rw-r--r-- | spec/models/ci/build_spec.rb | 2 | ||||
-rw-r--r-- | spec/models/ci/pipeline_spec.rb | 8 | ||||
-rw-r--r-- | spec/models/project_spec.rb | 20 | ||||
-rw-r--r-- | spec/requests/api/projects_spec.rb | 4 |
5 files changed, 18 insertions, 18 deletions
diff --git a/spec/lib/gitlab/import_export/safe_model_attributes.yml b/spec/lib/gitlab/import_export/safe_model_attributes.yml index f782cf533e8..697ddf52af9 100644 --- a/spec/lib/gitlab/import_export/safe_model_attributes.yml +++ b/spec/lib/gitlab/import_export/safe_model_attributes.yml @@ -383,7 +383,7 @@ Project: - printing_merge_request_link_enabled - build_allow_git_fetch - last_repository_updated_at -- ci_config_file +- ci_config_path Author: - name ProjectFeature: diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index e5fd549f0d7..f955d9c81b8 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -1474,7 +1474,7 @@ describe Ci::Build, :models do let(:ci_config_path) { { key: 'CI_CONFIG_PATH', value: 'custom', public: true } } before do - project.update(ci_config_file: 'custom') + project.update(ci_config_path: 'custom') end it { is_expected.to include(ci_config_path) } diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb index a24b1e6c818..ba0696fa210 100644 --- a/spec/models/ci/pipeline_spec.rb +++ b/spec/models/ci/pipeline_spec.rb @@ -752,19 +752,19 @@ describe Ci::Pipeline, models: true do subject { pipeline.ci_yaml_file_path } it 'returns the path from project' do - allow(pipeline.project).to receive(:ci_config_file) { 'custom/path' } + allow(pipeline.project).to receive(:ci_config_path) { 'custom/path' } is_expected.to eq('custom/path') end it 'returns default when custom path is nil' do - allow(pipeline.project).to receive(:ci_config_file) { nil } + allow(pipeline.project).to receive(:ci_config_path) { nil } is_expected.to eq('.gitlab-ci.yml') end it 'returns default when custom path is empty' do - allow(pipeline.project).to receive(:ci_config_file) { '' } + allow(pipeline.project).to receive(:ci_config_path) { '' } is_expected.to eq('.gitlab-ci.yml') end @@ -772,7 +772,7 @@ describe Ci::Pipeline, models: true do describe '#ci_yaml_file' do it 'reports error if the file is not found' do - allow(pipeline.project).to receive(:ci_config_file) { 'custom' } + allow(pipeline.project).to receive(:ci_config_path) { 'custom' } pipeline.ci_yaml_file diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index a682fa82bf0..6197a390da8 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -143,9 +143,9 @@ describe Project, models: true do it { is_expected.to validate_length_of(:description).is_at_most(2000) } - it { is_expected.to validate_length_of(:ci_config_file).is_at_most(255) } - it { is_expected.to allow_value('').for(:ci_config_file) } - it { is_expected.not_to allow_value('test/../foo').for(:ci_config_file) } + it { is_expected.to validate_length_of(:ci_config_path).is_at_most(255) } + it { is_expected.to allow_value('').for(:ci_config_path) } + it { is_expected.not_to allow_value('test/../foo').for(:ci_config_path) } it { is_expected.to validate_presence_of(:creator) } @@ -1493,25 +1493,25 @@ describe Project, models: true do end end - describe '#ci_config_file=' do + describe '#ci_config_path=' do let(:project) { create(:empty_project) } it 'sets nil' do - project.update!(ci_config_file: nil) + project.update!(ci_config_path: nil) - expect(project.ci_config_file).to be_nil + expect(project.ci_config_path).to be_nil end it 'sets a string' do - project.update!(ci_config_file: 'foo/.gitlab_ci.yml') + project.update!(ci_config_path: 'foo/.gitlab_ci.yml') - expect(project.ci_config_file).to eq('foo/.gitlab_ci.yml') + expect(project.ci_config_path).to eq('foo/.gitlab_ci.yml') end it 'sets a string but remove all leading slashes and null characters' do - project.update!(ci_config_file: "///f\0oo/\0/.gitlab_ci.yml") + project.update!(ci_config_path: "///f\0oo/\0/.gitlab_ci.yml") - expect(project.ci_config_file).to eq('foo//.gitlab_ci.yml') + expect(project.ci_config_path).to eq('foo//.gitlab_ci.yml') end end diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb index d19ce2d9887..8ac65ecccab 100644 --- a/spec/requests/api/projects_spec.rb +++ b/spec/requests/api/projects_spec.rb @@ -348,7 +348,7 @@ describe API::Projects do only_allow_merge_if_pipeline_succeeds: false, request_access_enabled: true, only_allow_merge_if_all_discussions_are_resolved: false, - ci_config_file: 'a/custom/path' + ci_config_path: 'a/custom/path' }) post api('/projects', user), project @@ -654,7 +654,7 @@ describe API::Projects do expect(json_response['star_count']).to be_present expect(json_response['forks_count']).to be_present expect(json_response['public_jobs']).to be_present - expect(json_response['ci_config_file']).to be_nil + expect(json_response['ci_config_path']).to be_nil expect(json_response['shared_with_groups']).to be_an Array expect(json_response['shared_with_groups'].length).to eq(1) expect(json_response['shared_with_groups'][0]['group_id']).to eq(group.id) |