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
8d23b964
Commit
8d23b964
authored
Feb 26, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify view specs for commit status badge partial
parent
79a37423
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
28 deletions
+33
-28
spec/views/ci/status/_badge.html.haml_spec.rb
spec/views/ci/status/_badge.html.haml_spec.rb
+33
-28
No files found.
spec/views/ci/status/_badge.html.haml_spec.rb
View file @
8d23b964
...
@@ -10,13 +10,13 @@ describe 'ci/status/_badge', :view do
...
@@ -10,13 +10,13 @@ describe 'ci/status/_badge', :view do
create
(
:ci_build
,
:success
,
pipeline:
pipeline
)
create
(
:ci_build
,
:success
,
pipeline:
pipeline
)
end
end
context
'when
status has
details'
do
context
'when
user has ability to see
details'
do
before
do
before
do
project
.
add_developer
(
user
)
project
.
add_developer
(
user
)
end
end
it
'has link to build details page'
do
it
'has link to build details page'
do
details_path
=
namespace_project_build_path
(
details_path
=
namespace_project_build_path
(
project
.
namespace
,
project
,
build
)
project
.
namespace
,
project
,
build
)
render_status
(
build
)
render_status
(
build
)
...
@@ -25,7 +25,7 @@ describe 'ci/status/_badge', :view do
...
@@ -25,7 +25,7 @@ describe 'ci/status/_badge', :view do
end
end
end
end
context
'when
status does not have
details'
do
context
'when
user do not have ability to see build
details'
do
before
do
before
do
render_status
(
build
)
render_status
(
build
)
end
end
...
@@ -41,39 +41,44 @@ describe 'ci/status/_badge', :view do
...
@@ -41,39 +41,44 @@ describe 'ci/status/_badge', :view do
end
end
context
'when rendering status for external job'
do
context
'when rendering status for external job'
do
before
do
context
'when user has ability to see commit status details'
do
project
.
add_developer
(
use
)
before
do
project
.
add_developer
(
user
)
end
render_status
(
external_job
)
context
'status has external target url'
do
end
before
do
external_job
=
create
(
:generic_commit_status
,
status: :running
,
pipeline:
pipeline
,
target_url:
'http://gitlab.com'
)
context
'status has external target url'
do
render_status
(
external_job
)
let
(
:external_job
)
do
end
create
(
:generic_commit_status
,
status: :running
,
pipeline:
pipeline
,
target_url:
'http://gitlab.com'
)
end
it
'contains valid commit status text'
do
it
'contains valid commit status text'
do
expect
(
rendered
).
to
have_content
'running'
expect
(
rendered
).
to
have_content
'running'
end
end
it
'has link to external status page'
do
it
'has link to external status page'
do
expect
(
rendered
).
to
have_link
'running'
,
href:
'http://gitlab.com'
expect
(
rendered
).
to
have_link
'running'
,
href:
'http://gitlab.com'
end
end
end
end
context
'status do not have external target url'
do
context
'status do not have external target url'
do
let
(
:external_job
)
do
before
do
create
(
:generic_commit_status
,
status: :canceled
)
external_job
=
create
(
:generic_commit_status
,
status: :canceled
)
end
it
'contains valid commit status text'
do
render_status
(
external_job
)
expect
(
rendered
).
to
have_content
'canceled'
end
end
it
'contains valid commit status text'
do
expect
(
rendered
).
to
have_content
'canceled'
end
it
'has link to external status page'
do
it
'has link to external status page'
do
expect
(
rendered
).
not_to
have_link
'canceled'
expect
(
rendered
).
not_to
have_link
'canceled'
end
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