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
Tatuya Kamada
gitlab-ce
Commits
19c7fc75
Commit
19c7fc75
authored
Dec 22, 2016
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tests for natural sorting of build names
parent
2eb0beb6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
spec/views/projects/pipelines/show.html.haml_spec.rb
spec/views/projects/pipelines/show.html.haml_spec.rb
+35
-0
No files found.
spec/views/projects/pipelines/show.html.haml_spec.rb
View file @
19c7fc75
...
...
@@ -45,6 +45,41 @@ describe 'projects/pipelines/show' do
expect
(
rendered
).
to
have_text
(
'jenkins'
)
end
it
'lists builds in the correct sort order'
do
create_build
(
'test'
,
1
,
'karma 0 20'
,
:created
)
create_build
(
'test'
,
1
,
'karma 12 20'
,
:created
)
create_build
(
'test'
,
1
,
'karma 1 20'
,
:created
)
create_build
(
'test'
,
1
,
'karma 10 20'
,
:created
)
create_build
(
'test'
,
1
,
'karma 11 20'
,
:created
)
create_build
(
'test'
,
1
,
'karma 2 20'
,
:created
)
create_build
(
'test'
,
1
,
'test 1.10'
,
:created
)
create_build
(
'test'
,
1
,
'test 1.5.1'
,
:created
)
create_build
(
'test'
,
1
,
'test 1 a'
,
:created
)
render
# spaced builds order
expected_order_1
=
[
'karma 0 20'
,
'karma 1 20'
,
'karma 2 20'
,
'karma 10 20'
,
'karma 11 20'
,
'karma 12 20'
].
join
(
' '
)
expect
(
rendered
).
to
have_text
(
expected_order_1
)
# decimal builds order
expected_order_2
=
[
'test 1 a'
,
'test 1.5.1'
,
'test 1.10'
].
join
(
' '
)
expect
(
rendered
).
to
have_text
(
expected_order_2
)
end
private
def
create_build
(
stage
,
stage_idx
,
name
,
status
)
...
...
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