diff options
Diffstat (limited to 'spec/scripts/trigger-build_spec.rb')
-rw-r--r-- | spec/scripts/trigger-build_spec.rb | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/spec/scripts/trigger-build_spec.rb b/spec/scripts/trigger-build_spec.rb index 760b9bda541..78cc57b6c91 100644 --- a/spec/scripts/trigger-build_spec.rb +++ b/spec/scripts/trigger-build_spec.rb @@ -16,7 +16,7 @@ RSpec.describe Trigger, feature_category: :tooling do 'CI_COMMIT_SHA' => 'ci_commit_sha', 'CI_MERGE_REQUEST_PROJECT_ID' => 'ci_merge_request_project_id', 'CI_MERGE_REQUEST_IID' => 'ci_merge_request_iid', - 'GITLAB_BOT_MULTI_PROJECT_PIPELINE_POLLING_TOKEN' => 'bot-token', + 'PROJECT_TOKEN_FOR_CI_SCRIPTS_API_USAGE' => 'bot-token', 'CI_JOB_TOKEN' => 'job-token', 'GITLAB_USER_NAME' => 'gitlab_user_name', 'GITLAB_USER_LOGIN' => 'gitlab_user_login', @@ -26,7 +26,7 @@ RSpec.describe Trigger, feature_category: :tooling do end let(:com_api_endpoint) { 'https://gitlab.com/api/v4' } - let(:com_api_token) { env['GITLAB_BOT_MULTI_PROJECT_PIPELINE_POLLING_TOKEN'] } + let(:com_api_token) { env['PROJECT_TOKEN_FOR_CI_SCRIPTS_API_USAGE'] } let(:com_gitlab_client) { double('com_gitlab_client') } let(:downstream_gitlab_client_endpoint) { com_api_endpoint } @@ -114,25 +114,6 @@ RSpec.describe Trigger, feature_category: :tooling do subject.invoke! end - - context 'with downstream_job_name: "foo"' do - let(:downstream_job) { Struct.new(:id, :name).new(42, 'foo') } - let(:paginated_resources) { Struct.new(:auto_paginate).new([downstream_job]) } - - before do - stub_env('CI_COMMIT_REF_NAME', "#{ref}-ee") - end - - it 'fetches the downstream job' do - expect_run_trigger_with_params - expect(downstream_gitlab_client).to receive(:pipeline_jobs) - .with(downstream_project_path, stubbed_pipeline.id).and_return(paginated_resources) - expect(Trigger::Job).to receive(:new) - .with(downstream_project_path, downstream_job.id, downstream_gitlab_client) - - subject.invoke!(downstream_job_name: 'foo') - end - end end end |