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
Jérome Perrin
gitlab-ce
Commits
c195b313
Commit
c195b313
authored
May 07, 2017
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make test that actually displays pipeline graph
parent
b46d38ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
67 deletions
+54
-67
spec/features/projects/pipelines/pipelines_spec.rb
spec/features/projects/pipelines/pipelines_spec.rb
+54
-0
spec/views/projects/pipelines/show.html.haml_spec.rb
spec/views/projects/pipelines/show.html.haml_spec.rb
+0
-67
No files found.
spec/features/projects/pipelines/pipelines_spec.rb
View file @
c195b313
...
...
@@ -370,6 +370,60 @@ describe 'Pipelines', :feature, :js do
end
end
describe
'GET /:project/pipelines/show'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:pipeline
)
do
create
(
:ci_empty_pipeline
,
project:
project
,
sha:
project
.
commit
.
id
,
user:
user
)
end
before
do
create_build
(
'build'
,
0
,
'build'
,
:success
)
create_build
(
'test'
,
1
,
'rspec 0:2'
,
:pending
)
create_build
(
'test'
,
1
,
'rspec 1:2'
,
:running
)
create_build
(
'test'
,
1
,
'spinach 0:2'
,
:created
)
create_build
(
'test'
,
1
,
'spinach 1:2'
,
:created
)
create_build
(
'test'
,
1
,
'audit'
,
:created
)
create_build
(
'deploy'
,
2
,
'production'
,
:created
)
create
(
:generic_commit_status
,
pipeline:
pipeline
,
stage:
'external'
,
name:
'jenkins'
,
stage_idx:
3
)
visit
namespace_project_pipeline_path
(
project
.
namespace
,
project
,
pipeline
)
wait_for_vue_resource
end
it
'shows a graph with grouped stages'
do
expect
(
page
).
to
have_css
(
'.js-pipeline-graph'
)
# expect(page).to have_css('.js-grouped-pipeline-dropdown')
# header
expect
(
page
).
to
have_text
(
"#
#{
pipeline
.
id
}
"
)
expect
(
page
).
to
have_css
(
'time'
,
text:
pipeline
.
created_at
.
strftime
(
"%b %d, %Y"
))
expect
(
page
).
to
have_selector
(
%Q(img[alt$="
#{
pipeline
.
user
.
name
}
's avatar"])
)
expect
(
page
).
to
have_link
(
pipeline
.
user
.
name
,
href:
user_path
(
pipeline
.
user
))
# stages
expect
(
page
).
to
have_text
(
'Build'
)
expect
(
page
).
to
have_text
(
'Test'
)
expect
(
page
).
to
have_text
(
'Deploy'
)
expect
(
page
).
to
have_text
(
'External'
)
# builds
expect
(
page
).
to
have_text
(
'rspec'
)
expect
(
page
).
to
have_text
(
'spinach'
)
expect
(
page
).
to
have_text
(
'rspec 0:2'
)
expect
(
page
).
to
have_text
(
'production'
)
expect
(
page
).
to
have_text
(
'jenkins'
)
end
def
create_build
(
stage
,
stage_idx
,
name
,
status
)
create
(
:ci_build
,
pipeline:
pipeline
,
stage:
stage
,
stage_idx:
stage_idx
,
name:
name
,
status:
status
)
end
end
describe
'POST /:project/pipelines'
do
let
(
:project
)
{
create
(
:project
)
}
...
...
spec/views/projects/pipelines/show.html.haml_spec.rb
deleted
100644 → 0
View file @
b46d38ae
require
'spec_helper'
describe
'projects/pipelines/show'
do
include
Devise
::
Test
::
ControllerHelpers
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:pipeline
)
do
create
(
:ci_empty_pipeline
,
project:
project
,
sha:
project
.
commit
.
id
,
user:
user
)
end
before
do
controller
.
prepend_view_path
(
'app/views/projects'
)
create_build
(
'build'
,
0
,
'build'
,
:success
)
create_build
(
'test'
,
1
,
'rspec 0:2'
,
:pending
)
create_build
(
'test'
,
1
,
'rspec 1:2'
,
:running
)
create_build
(
'test'
,
1
,
'spinach 0:2'
,
:created
)
create_build
(
'test'
,
1
,
'spinach 1:2'
,
:created
)
create_build
(
'test'
,
1
,
'audit'
,
:created
)
create_build
(
'deploy'
,
2
,
'production'
,
:created
)
create
(
:generic_commit_status
,
pipeline:
pipeline
,
stage:
'external'
,
name:
'jenkins'
,
stage_idx:
3
)
assign
(
:project
,
project
)
assign
(
:pipeline
,
pipeline
.
present
(
current_user:
user
))
assign
(
:commit
,
project
.
commit
)
allow
(
view
).
to
receive
(
:can?
).
and_return
(
true
)
end
it
'shows a graph with grouped stages'
do
render
expect
(
rendered
).
to
have_css
(
'.js-pipeline-graph'
)
expect
(
rendered
).
to
have_css
(
'.js-grouped-pipeline-dropdown'
)
# header
expect
(
rendered
).
to
have_text
(
"#
#{
pipeline
.
id
}
"
)
expect
(
rendered
).
to
have_css
(
'time'
,
text:
pipeline
.
created_at
.
strftime
(
"%b %d, %Y"
))
expect
(
rendered
).
to
have_selector
(
%Q(img[alt$="
#{
pipeline
.
user
.
name
}
's avatar"])
)
expect
(
rendered
).
to
have_link
(
pipeline
.
user
.
name
,
href:
user_path
(
pipeline
.
user
))
# stages
expect
(
rendered
).
to
have_text
(
'Build'
)
expect
(
rendered
).
to
have_text
(
'Test'
)
expect
(
rendered
).
to
have_text
(
'Deploy'
)
expect
(
rendered
).
to
have_text
(
'External'
)
# builds
expect
(
rendered
).
to
have_text
(
'rspec'
)
expect
(
rendered
).
to
have_text
(
'spinach'
)
expect
(
rendered
).
to
have_text
(
'rspec 0:2'
)
expect
(
rendered
).
to
have_text
(
'production'
)
expect
(
rendered
).
to
have_text
(
'jenkins'
)
end
private
def
create_build
(
stage
,
stage_idx
,
name
,
status
)
create
(
:ci_build
,
pipeline:
pipeline
,
stage:
stage
,
stage_idx:
stage_idx
,
name:
name
,
status:
status
)
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