summaryrefslogtreecommitdiff
path: root/spec/lib
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-06-07 12:45:59 +0000
committerDouwe Maan <douwe@gitlab.com>2016-06-07 12:45:59 +0000
commit3368afd7676ac50f62be05b9817a655fb19ac0c3 (patch)
treed0e43e9223a2d2b84a2bfc03a43f99e8984bbe7b /spec/lib
parent8c5712a4222eb9c941384f3e11f38189898a2bcb (diff)
parent8988c8743d2f74b7939a39fbd1c6ebcaa5ac6647 (diff)
downloadgitlab-ce-3368afd7676ac50f62be05b9817a655fb19ac0c3.tar.gz
Merge branch 'rename-ci-commit-phase-2' into 'master'
Rename Ci::Commit in specs This is second iteration of renaming Ci::Commit occurences, this time I try to rename all `let's` and `factories` to match what type of object is created: 1. Rename factories: `ci_[...]_commit_[...]` to `ci_[...]_pipeline_[...]`, 2. Rename all `let's(:[ci_]commit)` to `let(:pipeline)`, 3. Rename all occurrences of `[ci_]commit` to `pipeline` if Pipeline object is created cc @grzesiek @DouweM See merge request !4463
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/ci/charts_spec.rb10
-rw-r--r--spec/lib/gitlab/badge/build_spec.rb8
2 files changed, 9 insertions, 9 deletions
diff --git a/spec/lib/ci/charts_spec.rb b/spec/lib/ci/charts_spec.rb
index 9d1215a5760..9c6b4ea5086 100644
--- a/spec/lib/ci/charts_spec.rb
+++ b/spec/lib/ci/charts_spec.rb
@@ -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, commit: @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
diff --git a/spec/lib/gitlab/badge/build_spec.rb b/spec/lib/gitlab/badge/build_spec.rb
index 6b2b335d4fc..2034445a197 100644
--- a/spec/lib/gitlab/badge/build_spec.rb
+++ b/spec/lib/gitlab/badge/build_spec.rb
@@ -109,11 +109,11 @@ describe Gitlab::Badge::Build do
end
def create_build(project, sha, branch)
- ci_commit = create(:ci_commit, project: project,
- sha: sha,
- ref: branch)
+ pipeline = create(:ci_pipeline, project: project,
+ sha: sha,
+ ref: branch)
- create(:ci_build, commit: ci_commit)
+ create(:ci_build, pipeline: pipeline)
end
def status_node(data, status)