Skip to content
Snippets Groups Projects
Commit 20c7144e authored by Kamil Trzcińśki's avatar Kamil Trzcińśki
Browse files

Rename all `[ci_]commit` to `[ci_]pipeline` in specs and features

parent 8ce1896b
No related branches found
No related tags found
No related merge requests found
Showing
with 104 additions and 105 deletions
Loading
Loading
@@ -164,8 +164,8 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps
 
step 'commit has ci status' do
@project.enable_ci
ci_commit = create :ci_commit, project: @project, sha: sample_commit.id
create :ci_build, pipeline: ci_commit
pipeline = create :ci_pipeline, project: @project, sha: sample_commit.id
create :ci_build, pipeline: pipeline
end
 
step 'repository contains ".gitlab-ci.yml" file' do
Loading
Loading
Loading
Loading
@@ -519,8 +519,8 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
step '"Bug NS-05" has CI status' do
project = merge_request.source_project
project.enable_ci
ci_commit = create :ci_commit, project: project, sha: merge_request.last_commit.id, ref: merge_request.source_branch
create :ci_build, pipeline: ci_commit
pipeline = create :ci_pipeline, project: project, sha: merge_request.last_commit.id, ref: merge_request.source_branch
create :ci_build, pipeline: pipeline
end
 
step 'I should see merge request "Bug NS-05" with CI status' do
Loading
Loading
Loading
Loading
@@ -10,8 +10,8 @@ module SharedBuilds
end
 
step 'project has a recent build' do
@ci_commit = create(:ci_commit, project: @project, sha: @project.commit.sha, ref: 'master')
@build = create(:ci_build_with_coverage, commit: @ci_commit)
@pipeline = create(:ci_pipeline, project: @project, sha: @project.commit.sha, ref: 'master')
@build = create(:ci_build_with_coverage, pipeline: @pipeline)
end
 
step 'recent build is successful' do
Loading
Loading
@@ -23,7 +23,7 @@ module SharedBuilds
end
 
step 'project has another build that is running' do
create(:ci_build, pipeline: @ci_commit, name: 'second build', status: 'running')
create(:ci_build, pipeline: @pipeline, name: 'second build', status: 'running')
end
 
step 'I visit recent build details page' do
Loading
Loading
Loading
Loading
@@ -230,7 +230,7 @@ module SharedProject
 
step 'project "Shop" has CI build' do
project = Project.find_by(name: "Shop")
create :ci_commit, project: project, sha: project.commit.sha, ref: 'master', status: 'skipped'
create :ci_pipeline, project: project, sha: project.commit.sha, ref: 'master', status: 'skipped'
end
 
step 'I should see last commit with CI status' do
Loading
Loading
Loading
Loading
@@ -250,7 +250,7 @@ describe Projects::MergeRequestsController do
end
 
before do
create(:ci_empty_commit, project: project, sha: merge_request.source_sha, ref: merge_request.source_branch)
create(:ci_empty_pipeline, project: project, sha: merge_request.source_sha, ref: merge_request.source_branch)
end
 
it 'returns :merge_when_build_succeeds' do
Loading
Loading
Loading
Loading
@@ -16,7 +16,7 @@ FactoryGirl.define do
}
end
 
pipeline factory: :ci_commit
pipeline factory: :ci_pipeline
 
trait :success do
status 'success'
Loading
Loading
Loading
Loading
@@ -17,30 +17,30 @@
#
 
FactoryGirl.define do
factory :ci_empty_commit, class: Ci::Pipeline do
factory :ci_empty_pipeline, class: Ci::Pipeline do
sha '97de212e80737a608d939f648d959671fb0a0142'
 
project factory: :empty_project
 
factory :ci_commit_without_jobs do
factory :ci_pipeline_without_jobs do
after(:build) do |commit|
allow(commit).to receive(:ci_yaml_file) { YAML.dump({}) }
end
end
 
factory :ci_commit_with_one_job do
factory :ci_pipeline_with_one_job do
after(:build) do |commit|
allow(commit).to receive(:ci_yaml_file) { YAML.dump({ rspec: { script: "ls" } }) }
end
end
 
factory :ci_commit_with_two_jobs do
factory :ci_pipeline_with_two_job do
after(:build) do |commit|
allow(commit).to receive(:ci_yaml_file) { YAML.dump({ rspec: { script: "ls" }, spinach: { script: "ls" } }) }
end
end
 
factory :ci_commit do
factory :ci_pipeline do
after(:build) do |commit|
allow(commit).to receive(:ci_yaml_file) { File.read(Rails.root.join('spec/support/gitlab_stubs/gitlab_ci.yml')) }
end
Loading
Loading
Loading
Loading
@@ -3,7 +3,7 @@ FactoryGirl.define do
name 'default'
status 'success'
description 'commit status'
pipeline factory: :ci_commit_with_one_job
pipeline factory: :ci_pipeline_with_one_job
started_at 'Tue, 26 Jan 2016 08:21:42 +0100'
finished_at 'Tue, 26 Jan 2016 08:23:42 +0100'
 
Loading
Loading
Loading
Loading
@@ -6,15 +6,15 @@ describe 'Admin Builds' do
end
 
describe 'GET /admin/builds' do
let(:commit) { create(:ci_commit) }
let(:pipeline) { create(:ci_pipeline) }
 
context 'All tab' do
context 'when have builds' do
it 'shows all builds' do
create(:ci_build, pipeline: commit, status: :pending)
create(:ci_build, pipeline: commit, status: :running)
create(:ci_build, pipeline: commit, status: :success)
create(:ci_build, pipeline: commit, status: :failed)
create(:ci_build, pipeline: pipeline, status: :pending)
create(:ci_build, pipeline: pipeline, status: :running)
create(:ci_build, pipeline: pipeline, status: :success)
create(:ci_build, pipeline: pipeline, status: :failed)
 
visit admin_builds_path
 
Loading
Loading
@@ -39,9 +39,9 @@ describe 'Admin Builds' do
context 'Running tab' do
context 'when have running builds' do
it 'shows running builds' do
build1 = create(:ci_build, pipeline: commit, status: :pending)
build2 = create(:ci_build, pipeline: commit, status: :success)
build3 = create(:ci_build, pipeline: commit, status: :failed)
build1 = create(:ci_build, pipeline: pipeline, status: :pending)
build2 = create(:ci_build, pipeline: pipeline, status: :success)
build3 = create(:ci_build, pipeline: pipeline, status: :failed)
 
visit admin_builds_path(scope: :running)
 
Loading
Loading
@@ -55,7 +55,7 @@ describe 'Admin Builds' do
 
context 'when have no builds running' do
it 'shows a message' do
create(:ci_build, pipeline: commit, status: :success)
create(:ci_build, pipeline: pipeline, status: :success)
 
visit admin_builds_path(scope: :running)
 
Loading
Loading
@@ -69,9 +69,9 @@ describe 'Admin Builds' do
context 'Finished tab' do
context 'when have finished builds' do
it 'shows finished builds' do
build1 = create(:ci_build, pipeline: commit, status: :pending)
build2 = create(:ci_build, pipeline: commit, status: :running)
build3 = create(:ci_build, pipeline: commit, status: :success)
build1 = create(:ci_build, pipeline: pipeline, status: :pending)
build2 = create(:ci_build, pipeline: pipeline, status: :running)
build3 = create(:ci_build, pipeline: pipeline, status: :success)
 
visit admin_builds_path(scope: :finished)
 
Loading
Loading
@@ -85,7 +85,7 @@ describe 'Admin Builds' do
 
context 'when have no builds finished' do
it 'shows a message' do
create(:ci_build, pipeline: commit, status: :running)
create(:ci_build, pipeline: pipeline, status: :running)
 
visit admin_builds_path(scope: :finished)
 
Loading
Loading
Loading
Loading
@@ -8,8 +8,8 @@ describe "Admin Runners" do
describe "Runners page" do
before do
runner = FactoryGirl.create(:ci_runner)
commit = FactoryGirl.create(:ci_commit)
FactoryGirl.create(:ci_build, pipeline: commit, runner_id: runner.id)
pipeline = FactoryGirl.create(:ci_pipeline)
FactoryGirl.create(:ci_build, pipeline: pipeline, runner_id: runner.id)
visit admin_runners_path
end
 
Loading
Loading
Loading
Loading
@@ -5,7 +5,7 @@ describe "Builds" do
 
before do
login_as(:user)
@commit = FactoryGirl.create :ci_commit
@commit = FactoryGirl.create :ci_pipeline
@build = FactoryGirl.create :ci_build, pipeline: @commit
@project = @commit.project
@project.team << [@user, :developer]
Loading
Loading
Loading
Loading
@@ -8,15 +8,15 @@ describe 'Commits' do
describe 'CI' do
before do
login_as :user
stub_ci_commit_to_return_yaml_file
stub_ci_pipeline_to_return_yaml_file
end
 
let!(:commit) do
FactoryGirl.create :ci_commit, project: project, sha: project.commit.sha
let!(:pipeline) do
FactoryGirl.create :ci_pipeline, project: project, sha: project.commit.sha
end
 
context 'commit status is Generic Commit Status' do
let!(:status) { FactoryGirl.create :generic_commit_status, pipeline: commit }
let!(:status) { FactoryGirl.create :generic_commit_status, pipeline: pipeline }
 
before do
project.team << [@user, :reporter]
Loading
Loading
@@ -24,10 +24,10 @@ describe 'Commits' do
 
describe 'Commit builds' do
before do
visit ci_status_path(commit)
visit ci_status_path(pipeline)
end
 
it { expect(page).to have_content commit.sha[0..7] }
it { expect(page).to have_content pipeline.sha[0..7] }
 
it 'contains generic commit status build' do
page.within('.table-holder') do
Loading
Loading
@@ -39,7 +39,7 @@ describe 'Commits' do
end
 
context 'commit status is Ci Build' do
let!(:build) { FactoryGirl.create :ci_build, pipeline: commit }
let!(:build) { FactoryGirl.create :ci_build, pipeline: pipeline }
let(:artifacts_file) { fixture_file_upload(Rails.root + 'spec/fixtures/banana_sample.gif', 'image/gif') }
 
context 'when logged as developer' do
Loading
Loading
@@ -53,7 +53,7 @@ describe 'Commits' do
end
 
it 'should show build status' do
page.within("//li[@id='commit-#{commit.short_sha}']") do
page.within("//li[@id='commit-#{pipeline.short_sha}']") do
expect(page).to have_css(".ci-status-link")
end
end
Loading
Loading
@@ -61,12 +61,12 @@ describe 'Commits' do
 
describe 'Commit builds' do
before do
visit ci_status_path(commit)
visit ci_status_path(pipeline)
end
 
it { expect(page).to have_content commit.sha[0..7] }
it { expect(page).to have_content commit.git_commit_message }
it { expect(page).to have_content commit.git_author_name }
it { expect(page).to have_content pipeline.sha[0..7] }
it { expect(page).to have_content pipeline.git_commit_message }
it { expect(page).to have_content pipeline.git_author_name }
end
 
context 'Download artifacts' do
Loading
Loading
@@ -75,7 +75,7 @@ describe 'Commits' do
end
 
it do
visit ci_status_path(commit)
visit ci_status_path(pipeline)
click_on 'Download artifacts'
expect(page.response_headers['Content-Type']).to eq(artifacts_file.content_type)
end
Loading
Loading
@@ -83,7 +83,7 @@ describe 'Commits' do
 
describe 'Cancel all builds' do
it 'cancels commit' do
visit ci_status_path(commit)
visit ci_status_path(pipeline)
click_on 'Cancel running'
expect(page).to have_content 'canceled'
end
Loading
Loading
@@ -91,7 +91,7 @@ describe 'Commits' do
 
describe 'Cancel build' do
it 'cancels build' do
visit ci_status_path(commit)
visit ci_status_path(pipeline)
click_on 'Cancel'
expect(page).to have_content 'canceled'
end
Loading
Loading
@@ -100,13 +100,13 @@ describe 'Commits' do
describe '.gitlab-ci.yml not found warning' do
context 'ci builds enabled' do
it "does not show warning" do
visit ci_status_path(commit)
visit ci_status_path(pipeline)
expect(page).not_to have_content '.gitlab-ci.yml not found in this commit'
end
 
it 'shows warning' do
stub_ci_commit_yaml_file(nil)
visit ci_status_path(commit)
stub_ci_pipeline_yaml_file(nil)
visit ci_status_path(pipeline)
expect(page).to have_content '.gitlab-ci.yml not found in this commit'
end
end
Loading
Loading
@@ -114,8 +114,8 @@ describe 'Commits' do
context 'ci builds disabled' do
before do
stub_ci_builds_disabled
stub_ci_commit_yaml_file(nil)
visit ci_status_path(commit)
stub_ci_pipeline_yaml_file(nil)
visit ci_status_path(pipeline)
end
 
it 'does not show warning' do
Loading
Loading
@@ -129,13 +129,13 @@ describe 'Commits' do
before do
project.team << [@user, :reporter]
build.update_attributes(artifacts_file: artifacts_file)
visit ci_status_path(commit)
visit ci_status_path(pipeline)
end
 
it do
expect(page).to have_content commit.sha[0..7]
expect(page).to have_content commit.git_commit_message
expect(page).to have_content commit.git_author_name
expect(page).to have_content pipeline.sha[0..7]
expect(page).to have_content pipeline.git_commit_message
expect(page).to have_content pipeline.git_author_name
expect(page).to have_link('Download artifacts')
expect(page).not_to have_link('Cancel running')
expect(page).not_to have_link('Retry failed')
Loading
Loading
@@ -148,13 +148,13 @@ describe 'Commits' do
visibility_level: Gitlab::VisibilityLevel::INTERNAL,
public_builds: false)
build.update_attributes(artifacts_file: artifacts_file)
visit ci_status_path(commit)
visit ci_status_path(pipeline)
end
 
it do
expect(page).to have_content commit.sha[0..7]
expect(page).to have_content commit.git_commit_message
expect(page).to have_content commit.git_author_name
expect(page).to have_content pipeline.sha[0..7]
expect(page).to have_content pipeline.git_commit_message
expect(page).to have_content pipeline.git_author_name
expect(page).not_to have_link('Download artifacts')
expect(page).not_to have_link('Cancel running')
expect(page).not_to have_link('Retry failed')
Loading
Loading
Loading
Loading
@@ -29,7 +29,7 @@ feature 'Merge request created from fork' do
include WaitForAjax
 
given(:pipeline) do
create(:ci_commit_with_two_jobs, project: fork_project,
create(:ci_pipeline_with_two_job, project: fork_project,
sha: merge_request.last_commit.id,
ref: merge_request.source_branch)
end
Loading
Loading
Loading
Loading
@@ -12,7 +12,7 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
end
 
context "Active build for Merge Request" do
let!(:ci_commit) { create(:ci_commit, project: project, sha: merge_request.last_commit.id, ref: merge_request.source_branch) }
let!(:pipeline) { create(:ci_pipeline, project: project, sha: merge_request.last_commit.id, ref: merge_request.source_branch) }
let!(:ci_build) { create(:ci_build, pipeline: ci_commit) }
 
before do
Loading
Loading
@@ -47,8 +47,8 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
merge_user: user, title: "MepMep", merge_when_build_succeeds: true)
end
 
let!(:ci_commit) { create(:ci_commit, project: project, sha: merge_request.last_commit.id, ref: merge_request.source_branch) }
let!(:ci_build) { create(:ci_build, pipeline: ci_commit) }
let!(:pipeline) { create(:ci_pipeline, project: project, sha: merge_request.last_commit.id, ref: merge_request.source_branch) }
let!(:ci_build) { create(:ci_build, pipeline: pipeline) }
 
before do
login_as user
Loading
Loading
Loading
Loading
@@ -12,7 +12,7 @@ describe "Pipelines" do
end
 
describe 'GET /:project/pipelines' do
let!(:pipeline) { create(:ci_commit, project: project, ref: 'master', status: 'running') }
let!(:pipeline) { create(:ci_pipeline, project: project, ref: 'master', status: 'running') }
 
[:all, :running, :branches].each do |scope|
context "displaying #{scope}" do
Loading
Loading
@@ -111,7 +111,7 @@ describe "Pipelines" do
end
 
describe 'GET /:project/pipelines/:id' do
let(:pipeline) { create(:ci_commit, project: project, ref: 'master') }
let(:pipeline) { create(:ci_pipeline, project: project, ref: 'master') }
 
before do
@success = create(:ci_build, :success, pipeline: pipeline, stage: 'build', name: 'build')
Loading
Loading
@@ -165,7 +165,7 @@ describe "Pipelines" do
before { fill_in('Create for', with: 'master') }
 
context 'with gitlab-ci.yml' do
before { stub_ci_commit_to_return_yaml_file }
before { stub_ci_pipeline_to_return_yaml_file }
 
it { expect{ click_on 'Create pipeline' }.to change{ Ci::Pipeline.count }.by(1) }
end
Loading
Loading
Loading
Loading
@@ -11,7 +11,7 @@ feature 'project commit builds' do
 
context 'when no builds triggered yet' do
background do
create(:ci_commit, project: project,
create(:ci_pipeline, project: project,
sha: project.commit.sha,
ref: 'master')
end
Loading
Loading
Loading
Loading
@@ -142,8 +142,8 @@ describe "Public Project Access", feature: true do
end
 
describe "GET /:project_path/builds/:id" do
let(:commit) { create(:ci_commit, project: project) }
let(:build) { create(:ci_build, pipeline: commit) }
let(:pipeline) { create(:ci_pipeline, project: project) }
let(:build) { create(:ci_build, pipeline: pipeline) }
subject { namespace_project_build_path(project.namespace, project, build.id) }
 
context "when allowed for public" do
Loading
Loading
Loading
Loading
@@ -4,19 +4,19 @@ describe Ci::Charts, lib: true do
 
context "build_times" do
before do
@commit = FactoryGirl.create(:ci_commit)
FactoryGirl.create(:ci_build, pipeline: @commit)
@pipeline = FactoryGirl.create(:ci_pipeline)
FactoryGirl.create(:ci_build, pipeline: @pipeline)
end
 
it 'should return build times in minutes' do
chart = Ci::Charts::BuildTime.new(@commit.project)
chart = Ci::Charts::BuildTime.new(@pipeline.project)
expect(chart.build_times).to eq([2])
end
 
it 'should handle nil build times' do
create(:ci_commit, duration: nil, project: @commit.project)
create(:ci_pipeline, duration: nil, project: @pipeline.project)
 
chart = Ci::Charts::BuildTime.new(@commit.project)
chart = Ci::Charts::BuildTime.new(@pipeline.project)
expect(chart.build_times).to eq([2, 0])
end
end
Loading
Loading
Loading
Loading
@@ -42,9 +42,8 @@ describe Gitlab::Badge::Build do
end
 
context 'build exists' do
let(:ci_commit) { create(:ci_commit, project: project, sha: sha, ref: branch) }
let!(:build) { create(:ci_build, pipeline: ci_commit) }
let(:pipeline) { create(:ci_pipeline, project: project, sha: sha, ref: branch) }
let!(:build) { create(:ci_build, pipeline: pipeline) }
 
context 'build success' do
before { build.success! }
Loading
Loading
Loading
Loading
@@ -2,16 +2,16 @@ require 'spec_helper'
 
describe Ci::Build, models: true do
let(:project) { create(:project) }
let(:commit) { create(:ci_commit, project: project) }
let(:build) { create(:ci_build, pipeline: commit) }
let(:pipeline) { create(:ci_pipeline, project: project) }
let(:build) { create(:ci_build, pipeline: pipeline) }
 
it { is_expected.to validate_presence_of :ref }
 
it { is_expected.to respond_to :trace_html }
 
describe '#first_pending' do
let!(:first) { create(:ci_build, pipeline: commit, status: 'pending', created_at: Date.yesterday) }
let!(:second) { create(:ci_build, pipeline: commit, status: 'pending') }
let!(:first) { create(:ci_build, pipeline: pipeline, status: 'pending', created_at: Date.yesterday) }
let!(:second) { create(:ci_build, pipeline: pipeline, status: 'pending') }
subject { Ci::Build.first_pending }
 
it { is_expected.to be_a(Ci::Build) }
Loading
Loading
@@ -97,7 +97,7 @@ describe Ci::Build, models: true do
# describe :timeout do
# subject { build.timeout }
#
# it { is_expected.to eq(commit.project.timeout) }
# it { is_expected.to eq(pipeline.project.timeout) }
# end
 
describe '#options' do
Loading
Loading
@@ -124,13 +124,13 @@ describe Ci::Build, models: true do
describe '#project' do
subject { build.project }
 
it { is_expected.to eq(commit.project) }
it { is_expected.to eq(pipeline.project) }
end
 
describe '#project_id' do
subject { build.project_id }
 
it { is_expected.to eq(commit.project_id) }
it { is_expected.to eq(pipeline.project_id) }
end
 
describe '#project_name' do
Loading
Loading
@@ -219,7 +219,7 @@ describe Ci::Build, models: true do
 
context 'and trigger variables' do
let(:trigger) { create(:ci_trigger, project: project) }
let(:trigger_request) { create(:ci_trigger_request_with_variables, commit: commit, trigger: trigger) }
let(:trigger_request) { create(:ci_trigger_request_with_variables, pipeline: pipeline, trigger: trigger) }
let(:trigger_variables) do
[
{ key: :TRIGGER_KEY, value: 'TRIGGER_VALUE', public: false }
Loading
Loading
@@ -428,10 +428,10 @@ describe Ci::Build, models: true do
end
 
describe '#depends_on_builds' do
let!(:build) { create(:ci_build, pipeline: commit, name: 'build', stage_idx: 0, stage: 'build') }
let!(:rspec_test) { create(:ci_build, pipeline: commit, name: 'rspec', stage_idx: 1, stage: 'test') }
let!(:rubocop_test) { create(:ci_build, pipeline: commit, name: 'rubocop', stage_idx: 1, stage: 'test') }
let!(:staging) { create(:ci_build, pipeline: commit, name: 'staging', stage_idx: 2, stage: 'deploy') }
let!(:build) { create(:ci_build, pipeline: pipeline, name: 'build', stage_idx: 0, stage: 'build') }
let!(:rspec_test) { create(:ci_build, pipeline: pipeline, name: 'rspec', stage_idx: 1, stage: 'test') }
let!(:rubocop_test) { create(:ci_build, pipeline: pipeline, name: 'rubocop', stage_idx: 1, stage: 'test') }
let!(:staging) { create(:ci_build, pipeline: pipeline, name: 'staging', stage_idx: 2, stage: 'deploy') }
 
it 'to have no dependents if this is first build' do
expect(build.depends_on_builds).to be_empty
Loading
Loading
@@ -451,19 +451,19 @@ describe Ci::Build, models: true do
end
end
 
def create_mr(build, commit, factory: :merge_request, created_at: Time.now)
create(factory, source_project_id: commit.gl_project_id,
target_project_id: commit.gl_project_id,
def create_mr(build, pipeline, factory: :merge_request, created_at: Time.now)
create(factory, source_project_id: pipeline.gl_project_id,
target_project_id: pipeline.gl_project_id,
source_branch: build.ref,
created_at: created_at)
end
 
describe '#merge_request' do
context 'when a MR has a reference to the commit' do
context 'when a MR has a reference to the pipeline' do
before do
@merge_request = create_mr(build, commit, factory: :merge_request)
@merge_request = create_mr(build, pipeline, factory: :merge_request)
 
commits = [double(id: commit.sha)]
commits = [double(id: pipeline.sha)]
allow(@merge_request).to receive(:commits).and_return(commits)
allow(MergeRequest).to receive_message_chain(:includes, :where, :reorder).and_return([@merge_request])
end
Loading
Loading
@@ -473,19 +473,19 @@ describe Ci::Build, models: true do
end
end
 
context 'when there is not a MR referencing the commit' do
context 'when there is not a MR referencing the pipeline' do
it 'returns nil' do
expect(build.merge_request).to be_nil
end
end
 
context 'when more than one MR have a reference to the commit' do
context 'when more than one MR have a reference to the pipeline' do
before do
@merge_request = create_mr(build, commit, factory: :merge_request)
@merge_request = create_mr(build, pipeline, factory: :merge_request)
@merge_request.close!
@merge_request2 = create_mr(build, commit, factory: :merge_request)
@merge_request2 = create_mr(build, pipeline, factory: :merge_request)
 
commits = [double(id: commit.sha)]
commits = [double(id: pipeline.sha)]
allow(@merge_request).to receive(:commits).and_return(commits)
allow(@merge_request2).to receive(:commits).and_return(commits)
allow(MergeRequest).to receive_message_chain(:includes, :where, :reorder).and_return([@merge_request, @merge_request2])
Loading
Loading
@@ -498,11 +498,11 @@ describe Ci::Build, models: true do
 
context 'when a Build is created after the MR' do
before do
@merge_request = create_mr(build, commit, factory: :merge_request_with_diffs)
commit2 = create(:ci_commit, project: project)
@build2 = create(:ci_build, pipeline: commit2)
@merge_request = create_mr(build, pipeline, factory: :merge_request_with_diffs)
pipeline2 = create(:ci_pipeline, project: project)
@build2 = create(:ci_build, pipeline: pipeline2)
 
commits = [double(id: commit.sha), double(id: commit2.sha)]
commits = [double(id: pipeline.sha), double(id: pipeline2.sha)]
allow(@merge_request).to receive(:commits).and_return(commits)
allow(MergeRequest).to receive_message_chain(:includes, :where, :reorder).and_return([@merge_request])
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment