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
58d6120a
Commit
58d6120a
authored
Nov 25, 2016
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds tests for builds url and tabs behaviour
parent
cc4434a4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
89 additions
and
3 deletions
+89
-3
app/views/projects/pipelines/_with_tabs.html.haml
app/views/projects/pipelines/_with_tabs.html.haml
+2
-2
app/views/projects/pipelines/show.html.haml
app/views/projects/pipelines/show.html.haml
+1
-1
spec/features/projects/pipelines_spec.rb
spec/features/projects/pipelines_spec.rb
+86
-0
No files found.
app/views/projects/pipelines/_with_tabs.html.haml
View file @
58d6120a
.tabs-holder
%ul
.pipelines-tabs.nav-links.no-top.no-bottom
%li
%li
.js-pipeline-tab-link
=
link_to
namespace_project_pipeline_path
(
@project
.
namespace
,
@project
,
@pipeline
),
data:
{
target:
'div#js-tab-pipeline'
,
action:
'pipelines'
,
toggle:
'tab'
},
class:
'pipeline-tab'
do
Pipeline
%li
%li
.js-builds-tab-link
=
link_to
builds_namespace_project_pipeline_path
(
@project
.
namespace
,
@project
,
@pipeline
),
data:
{
target:
'div#js-tab-builds'
,
action:
'builds'
,
toggle:
'tab'
},
class:
'builds-tab'
do
Builds
%span
.badge.js-builds-counter
=
pipeline
.
statuses
.
count
...
...
app/views/projects/pipelines/show.html.haml
View file @
58d6120a
...
...
@@ -2,7 +2,7 @@
-
page_title
"Pipeline"
=
render
"projects/pipelines/head"
%div
.js-pipeline-container
{
class:
container_class
,
data:
{
controller_action:
"#{controller.action_name}"
}
}
%div
.js-pipeline-container
{
class:
container_class
,
data:
{
controller_action:
"#{controller.action_name}"
}
}
-
if
@commit
=
render
"projects/pipelines/info"
...
...
spec/features/projects/pipelines_spec.rb
View file @
58d6120a
...
...
@@ -178,6 +178,88 @@ describe "Pipelines" do
expect
(
page
).
to
have_link
(
'Play'
)
end
it
'shows Pipeline tab pane as active'
do
expect
(
page
).
to
have_css
(
'#js-tab-pipeline.active'
)
end
context
'page tabs'
do
it
'shows Pipeline and Builds tabs with link'
do
expect
(
page
).
to
have_link
(
'Pipeline'
)
expect
(
page
).
to
have_link
(
'Builds'
)
end
it
'shows counter in Builds tab'
do
expect
(
page
.
find
(
'.js-builds-counter'
).
text
).
to
eq
(
pipeline
.
statuses
.
count
.
to_s
)
end
it
'shows Pipeline tab as active'
do
expect
(
page
).
to
have_css
(
'li.js-pipeline-tab-link.active'
)
end
end
context
'retrying builds'
do
it
{
expect
(
page
).
not_to
have_content
(
'retried'
)
}
context
'when retrying'
do
before
{
click_on
'Retry failed'
}
it
{
expect
(
page
).
not_to
have_content
(
'Retry failed'
)
}
it
{
expect
(
page
).
to
have_selector
(
'.retried'
)
}
end
end
context
'canceling builds'
do
it
{
expect
(
page
).
not_to
have_selector
(
'.ci-canceled'
)
}
context
'when canceling'
do
before
{
click_on
'Cancel running'
}
it
{
expect
(
page
).
not_to
have_content
(
'Cancel running'
)
}
it
{
expect
(
page
).
to
have_selector
(
'.ci-canceled'
)
}
end
end
context
'playing manual build'
do
before
do
within
'.pipeline-holder'
do
click_link
(
'Play'
)
end
end
it
{
expect
(
@manual
.
reload
).
to
be_pending
}
end
end
describe
'GET /:project/pipelines/:id/builds'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
,
ref:
'master'
,
sha:
project
.
commit
.
id
)
}
before
do
@success
=
create
(
:ci_build
,
:success
,
pipeline:
pipeline
,
stage:
'build'
,
name:
'build'
)
@failed
=
create
(
:ci_build
,
:failed
,
pipeline:
pipeline
,
stage:
'test'
,
name:
'test'
,
commands:
'test'
)
@running
=
create
(
:ci_build
,
:running
,
pipeline:
pipeline
,
stage:
'deploy'
,
name:
'deploy'
)
@manual
=
create
(
:ci_build
,
:manual
,
pipeline:
pipeline
,
stage:
'deploy'
,
name:
'manual build'
)
@external
=
create
(
:generic_commit_status
,
status:
'success'
,
pipeline:
pipeline
,
name:
'jenkins'
,
stage:
'external'
)
end
before
{
visit
builds_namespace_project_pipeline_path
(
project
.
namespace
,
project
,
pipeline
)}
it
'shows a list of builds'
do
expect
(
page
).
to
have_content
(
'Test'
)
expect
(
page
).
to
have_content
(
@success
.
id
)
expect
(
page
).
to
have_content
(
'Deploy'
)
expect
(
page
).
to
have_content
(
@failed
.
id
)
expect
(
page
).
to
have_content
(
@running
.
id
)
expect
(
page
).
to
have_content
(
@external
.
id
)
expect
(
page
).
to
have_content
(
'Retry failed'
)
expect
(
page
).
to
have_content
(
'Cancel running'
)
expect
(
page
).
to
have_link
(
'Play'
)
end
it
'shows Builds tab pane as active'
do
expect
(
page
).
to
have_css
(
'#js-tab-builds.active'
)
end
context
'page tabs'
do
it
'shows Pipeline and Builds tabs with link'
do
expect
(
page
).
to
have_link
(
'Pipeline'
)
...
...
@@ -187,6 +269,10 @@ describe "Pipelines" do
it
'shows counter in Builds tab'
do
expect
(
page
.
find
(
'.js-builds-counter'
).
text
).
to
eq
(
pipeline
.
statuses
.
count
.
to_s
)
end
it
'shows Builds tab as active'
do
expect
(
page
).
to
have_css
(
'li.js-builds-tab-link.active'
)
end
end
context
'retrying builds'
do
...
...
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