Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-09-09 12:11:16 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-09-09 12:11:16 +0300
commit54573816ab79fac6716d1a1eae8c0da602765774 (patch)
tree2ebdf1558969cc88eacba7ce5618a299c88dcf3d /spec/controllers/projects
parent8602c599660974a47ad705fd5cc3f97cd37b1a0f (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers/projects')
-rw-r--r--spec/controllers/projects/pipelines_controller_spec.rb32
1 files changed, 32 insertions, 0 deletions
diff --git a/spec/controllers/projects/pipelines_controller_spec.rb b/spec/controllers/projects/pipelines_controller_spec.rb
index 774971e992d..1354e894872 100644
--- a/spec/controllers/projects/pipelines_controller_spec.rb
+++ b/spec/controllers/projects/pipelines_controller_spec.rb
@@ -1292,6 +1292,38 @@ RSpec.describe Projects::PipelinesController do
end
end
+ context 'when project uses external project ci config' do
+ let(:other_project) { create(:project) }
+ let(:sha) { 'master' }
+ let(:service) { ::Ci::ListConfigVariablesService.new(other_project, user) }
+
+ let(:ci_config) do
+ {
+ variables: {
+ KEY1: { value: 'val 1', description: 'description 1' }
+ },
+ test: {
+ stage: 'test',
+ script: 'echo'
+ }
+ }
+ end
+
+ before do
+ project.update!(ci_config_path: ".gitlab-ci.yml@#{other_project.full_path}")
+ synchronous_reactive_cache(service)
+ end
+
+ it 'returns other project config variables' do
+ expect(::Ci::ListConfigVariablesService).to receive(:new).with(other_project, anything).and_return(service)
+
+ get_config_variables
+
+ expect(response).to have_gitlab_http_status(:ok)
+ expect(json_response['KEY1']).to eq({ 'value' => 'val 1', 'description' => 'description 1' })
+ end
+ end
+
private
def stub_gitlab_ci_yml_for_sha(sha, result)