diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-06-03 14:46:17 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-06-03 14:46:17 +0200 |
commit | 4d5f7aa00827f425dd3d2c3bd5a395c8e948f0ba (patch) | |
tree | dc5446ac09424f48cd5b59df67ab7059ac60aa49 /spec | |
parent | bcd009e661291554cffe404123de629860519602 (diff) | |
download | gitlab-ce-4d5f7aa00827f425dd3d2c3bd5a395c8e948f0ba.tar.gz |
Fix more places where we should rename ci_commit to pipeline
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/build_spec.rb | 2 | ||||
-rw-r--r-- | spec/models/ci/pipeline_spec.rb (renamed from spec/models/ci/commit_spec.rb) | 2 | ||||
-rw-r--r-- | spec/models/commit_status_spec.rb | 10 | ||||
-rw-r--r-- | spec/models/merge_request_spec.rb | 12 | ||||
-rw-r--r-- | spec/models/project_spec.rb | 2 | ||||
-rw-r--r-- | spec/services/merge_requests/merge_when_build_succeeds_service_spec.rb | 4 |
6 files changed, 16 insertions, 16 deletions
diff --git a/spec/models/build_spec.rb b/spec/models/build_spec.rb index 86d581721b1..6c30d85249a 100644 --- a/spec/models/build_spec.rb +++ b/spec/models/build_spec.rb @@ -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, pipeline: commit, trigger: trigger) } + let(:trigger_request) { create(:ci_trigger_request_with_variables, commit: commit, trigger: trigger) } let(:trigger_variables) do [ { key: :TRIGGER_KEY, value: 'TRIGGER_VALUE', public: false } diff --git a/spec/models/ci/commit_spec.rb b/spec/models/ci/pipeline_spec.rb index 8426f28d445..2f8b1d790a7 100644 --- a/spec/models/ci/commit_spec.rb +++ b/spec/models/ci/pipeline_spec.rb @@ -334,7 +334,7 @@ describe Ci::Pipeline, models: true do describe '#stages' do let(:commit2) { FactoryGirl.create :ci_commit, project: project } - subject { CommitStatus.where(commit: [commit, commit2]).stages } + subject { CommitStatus.where(pipeline: [commit, commit2]).stages } before do FactoryGirl.create :ci_build, pipeline: commit2, stage: 'test', stage_idx: 1 diff --git a/spec/models/commit_status_spec.rb b/spec/models/commit_status_spec.rb index b435d835722..ca630e5bc9c 100644 --- a/spec/models/commit_status_spec.rb +++ b/spec/models/commit_status_spec.rb @@ -4,15 +4,15 @@ describe CommitStatus, models: true do let(:commit) { FactoryGirl.create :ci_commit } let(:commit_status) { FactoryGirl.create :commit_status, pipeline: commit } - it { is_expected.to belong_to(:commit) } + it { is_expected.to belong_to(:pipeline) } it { is_expected.to belong_to(:user) } it { is_expected.to belong_to(:project) } it { is_expected.to validate_presence_of(:name) } it { is_expected.to validate_inclusion_of(:status).in_array(%w(pending running failed success canceled)) } - it { is_expected.to delegate_method(:sha).to(:commit) } - it { is_expected.to delegate_method(:short_sha).to(:commit) } + it { is_expected.to delegate_method(:sha).to(:pipeline) } + it { is_expected.to delegate_method(:short_sha).to(:pipeline) } it { is_expected.to respond_to :success? } it { is_expected.to respond_to :failed? } @@ -179,7 +179,7 @@ describe CommitStatus, models: true do end context 'stages list' do - subject { CommitStatus.where(commit: commit).stages } + subject { CommitStatus.where(pipeline: commit).stages } it 'return ordered list of stages' do is_expected.to eq(%w(build test deploy)) @@ -187,7 +187,7 @@ describe CommitStatus, models: true do end context 'stages with statuses' do - subject { CommitStatus.where(commit: commit).stages_status } + subject { CommitStatus.where(pipeline: commit).stages_status } it 'return list of stages with statuses' do is_expected.to eq({ diff --git a/spec/models/merge_request_spec.rb b/spec/models/merge_request_spec.rb index 348f2e2f493..21d7a8d8364 100644 --- a/spec/models/merge_request_spec.rb +++ b/spec/models/merge_request_spec.rb @@ -390,19 +390,19 @@ describe MergeRequest, models: true do subject { create :merge_request, :simple } end - describe '#ci_commit' do + describe '#pipeline' do describe 'when the source project exists' do it 'returns the latest commit' do - commit = double(:commit, id: '123abc') - ci_commit = double(:ci_commit, ref: 'master') + commit = double(:commit, id: '123abc') + pipeline = double(:ci_commit, ref: 'master') allow(subject).to receive(:last_commit).and_return(commit) - expect(subject.source_project).to receive(:ci_commit). + expect(subject.source_project).to receive(:pipeline). with('123abc', 'master'). - and_return(ci_commit) + and_return(pipeline) - expect(subject.pipeline).to eq(ci_commit) + expect(subject.pipeline).to eq(pipeline) end end diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 44debdbdc1c..1135d7b6099 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -22,7 +22,7 @@ describe Project, models: true do it { is_expected.to have_one(:pushover_service).dependent(:destroy) } it { is_expected.to have_one(:asana_service).dependent(:destroy) } it { is_expected.to have_many(:commit_statuses) } - it { is_expected.to have_many(:ci_commits) } + it { is_expected.to have_many(:pipelines) } it { is_expected.to have_many(:builds) } it { is_expected.to have_many(:runner_projects) } it { is_expected.to have_many(:runners) } diff --git a/spec/services/merge_requests/merge_when_build_succeeds_service_spec.rb b/spec/services/merge_requests/merge_when_build_succeeds_service_spec.rb index 7f8ea8d7c25..d050f4cd95c 100644 --- a/spec/services/merge_requests/merge_when_build_succeeds_service_spec.rb +++ b/spec/services/merge_requests/merge_when_build_succeeds_service_spec.rb @@ -110,8 +110,8 @@ describe MergeRequests::MergeWhenBuildSucceedsService do context 'properly handles multiple stages' do let(:ref) { mr_merge_if_green_enabled.source_branch } - let(:build) { create(:ci_build, commit: ci_commit, ref: ref, name: 'build', stage: 'build') } - let(:test) { create(:ci_build, commit: ci_commit, ref: ref, name: 'test', stage: 'test') } + let(:build) { create(:ci_build, pipeline: ci_commit, ref: ref, name: 'build', stage: 'build') } + let(:test) { create(:ci_build, pipeline: ci_commit, ref: ref, name: 'test', stage: 'test') } before do # This behavior of MergeRequest: we instantiate a new object |