Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
78383c41
Commit
78383c41
authored
Dec 08, 2018
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use build for testing HasRef
parent
6cd09652
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
spec/models/concerns/has_ref_spec.rb
spec/models/concerns/has_ref_spec.rb
+8
-8
No files found.
spec/models/concerns/has_ref_spec.rb
View file @
78383c41
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment