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
Boxiang Sun
gitlab-ce
Commits
e02ca5fd
Commit
e02ca5fd
authored
May 11, 2017
by
Stefan Hanreich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated spec for build to include new ref_slug invariants
parent
39b2d730
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
8 deletions
+16
-8
spec/models/ci/build_spec.rb
spec/models/ci/build_spec.rb
+16
-8
No files found.
spec/models/ci/build_spec.rb
View file @
e02ca5fd
...
@@ -1033,19 +1033,27 @@ describe Ci::Build, :models do
...
@@ -1033,19 +1033,27 @@ describe Ci::Build, :models do
end
end
describe
'#ref_slug'
do
describe
'#ref_slug'
do
let
(
:build
)
{
build
(
:ci_build
,
ref:
"'100%"
)
}
subject
{
build
.
ref_slug
}
it
{
is_expected
.
not_to
start_with
(
'-'
)
}
it
{
is_expected
.
not_to
end_with
(
'-'
)
}
{
{
'master'
=>
'master'
,
'master'
=>
'master'
,
'1-foo'
=>
'1-foo'
,
'1-foo'
=>
'1-foo'
,
'fix/1-foo'
=>
'fix-1-foo'
,
'fix/1-foo'
=>
'fix-1-foo'
,
'fix-1-foo'
=>
'fix-1-foo'
,
'fix-1-foo'
=>
'fix-1-foo'
,
'a'
*
63
=>
'a'
*
63
,
'a'
*
63
=>
'a'
*
63
,
'a'
*
64
=>
'a'
*
63
,
'a'
*
64
=>
'a'
*
63
,
'FOO'
=>
'foo'
'FOO'
=>
'foo'
,
'-'
+
'a'
*
61
+
'-'
=>
'a'
*
61
,
'a'
*
62
+
' '
=>
'a'
*
62
,
}.
each
do
|
ref
,
slug
|
}.
each
do
|
ref
,
slug
|
it
"transforms
#{
ref
}
to
#{
slug
}
"
do
it
"transforms
#{
ref
}
to
#{
slug
}
"
do
build
.
ref
=
ref
build
.
ref
=
ref
expect
(
build
.
ref_slug
)
.
to
eq
(
slug
)
is_expected
.
to
eq
(
slug
)
end
end
end
end
end
end
...
...
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