summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2018-12-08 20:39:11 +0100
committerMatija Čupić <matteeyah@gmail.com>2018-12-08 20:39:11 +0100
commit78383c41bb51d50d970f0056e80f698960ed40dd (patch)
tree250a01bf23ac00b741d853ced562f230e88989d1
parent6cd0965233822fe31366d0763633de6bb11d8d72 (diff)
downloadgitlab-ce-78383c41bb51d50d970f0056e80f698960ed40dd.tar.gz
Use build for testing HasRef
-rw-r--r--spec/models/concerns/has_ref_spec.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/spec/models/concerns/has_ref_spec.rb b/spec/models/concerns/has_ref_spec.rb
index 14db197dfe0..8aed72d77a4 100644
--- a/spec/models/concerns/has_ref_spec.rb
+++ b/spec/models/concerns/has_ref_spec.rb
@@ -4,13 +4,13 @@ require 'spec_helper'
describe HasRef do
describe '#branch?' do
- let(:pipeline) { create(:ci_pipeline) }
+ let(:build) { create(:ci_build) }
- subject { pipeline.branch? }
+ subject { build.branch? }
context 'is not a tag' do
before do
- pipeline.tag = false
+ build.tag = false
end
it 'return true when tag is set to false' do
@@ -20,7 +20,7 @@ describe HasRef do
context 'is not a tag' do
before do
- pipeline.tag = true
+ build.tag = true
end
it 'return false when tag is set to true' do
@@ -30,10 +30,10 @@ describe HasRef do
end
describe '#git_ref' do
- subject { pipeline.git_ref }
+ subject { build.git_ref }
context 'when tag is true' do
- let(:pipeline) { create(:ci_pipeline, tag: true) }
+ let(:build) { create(:ci_build, tag: true) }
it 'returns a tag ref' do
is_expected.to start_with(Gitlab::Git::TAG_REF_PREFIX)
@@ -41,7 +41,7 @@ describe HasRef do
end
context 'when tag is false' do
- let(:pipeline) { create(:ci_pipeline, tag: false) }
+ let(:build) { create(:ci_build, tag: false) }
it 'returns a branch ref' do
is_expected.to start_with(Gitlab::Git::BRANCH_REF_PREFIX)
@@ -49,7 +49,7 @@ describe HasRef do
end
context 'when tag is nil' do
- let(:pipeline) { create(:ci_pipeline, tag: nil) }
+ let(:build) { create(:ci_build, tag: nil) }
it 'returns a branch ref' do
is_expected.to start_with(Gitlab::Git::BRANCH_REF_PREFIX)