diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-09 12:11:16 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-09 12:11:16 +0300 |
commit | 54573816ab79fac6716d1a1eae8c0da602765774 (patch) | |
tree | 2ebdf1558969cc88eacba7ce5618a299c88dcf3d /spec/controllers | |
parent | 8602c599660974a47ad705fd5cc3f97cd37b1a0f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/admin/users_controller_spec.rb | 2 | ||||
-rw-r--r-- | spec/controllers/projects/pipelines_controller_spec.rb | 32 |
2 files changed, 33 insertions, 1 deletions
diff --git a/spec/controllers/admin/users_controller_spec.rb b/spec/controllers/admin/users_controller_spec.rb index 6e172f53257..2d5125c9d5e 100644 --- a/spec/controllers/admin/users_controller_spec.rb +++ b/spec/controllers/admin/users_controller_spec.rb @@ -165,7 +165,7 @@ RSpec.describe Admin::UsersController do it 'displays the error' do subject - expect(flash[:alert]).to eq('This user does not have a pending request') + expect(flash[:alert]).to eq('User does not have a pending request') end it 'does not email the user' do 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) |