diff options
Diffstat (limited to 'spec/controllers/projects/pipelines/stages_controller_spec.rb')
-rw-r--r-- | spec/controllers/projects/pipelines/stages_controller_spec.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/spec/controllers/projects/pipelines/stages_controller_spec.rb b/spec/controllers/projects/pipelines/stages_controller_spec.rb index 6e8c08d95a1..a8b328c7563 100644 --- a/spec/controllers/projects/pipelines/stages_controller_spec.rb +++ b/spec/controllers/projects/pipelines/stages_controller_spec.rb @@ -5,6 +5,7 @@ require 'spec_helper' RSpec.describe Projects::Pipelines::StagesController do let(:user) { create(:user) } let(:project) { create(:project, :repository) } + let(:downstream_project) { create(:project, :repository) } before do sign_in(user) @@ -17,6 +18,7 @@ RSpec.describe Projects::Pipelines::StagesController do before do create_manual_build(pipeline, 'test', 'rspec 1/2') create_manual_build(pipeline, 'test', 'rspec 2/2') + create_manual_bridge(pipeline, 'test', 'trigger') pipeline.reload end @@ -32,6 +34,7 @@ RSpec.describe Projects::Pipelines::StagesController do context 'when user has access' do before do project.add_maintainer(user) + downstream_project.add_maintainer(user) end context 'when the stage does not exists' do @@ -46,12 +49,12 @@ RSpec.describe Projects::Pipelines::StagesController do context 'when the stage exists' do it 'starts all manual jobs' do - expect(pipeline.builds.manual.count).to eq(2) + expect(pipeline.processables.manual.count).to eq(3) play_manual_stage! expect(response).to have_gitlab_http_status(:ok) - expect(pipeline.builds.manual.count).to eq(0) + expect(pipeline.processables.manual.count).to eq(0) end end end @@ -68,5 +71,9 @@ RSpec.describe Projects::Pipelines::StagesController do def create_manual_build(pipeline, stage, name) create(:ci_build, :manual, pipeline: pipeline, stage: stage, name: name) end + + def create_manual_bridge(pipeline, stage, name) + create(:ci_bridge, :manual, pipeline: pipeline, stage: stage, name: name, downstream: downstream_project) + end end end |