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
Léo-Paul Géneau
gitlab-ce
Commits
d55fb906
Commit
d55fb906
authored
Nov 10, 2016
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tests for build row templates
parent
f47de1da
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
0 deletions
+56
-0
spec/views/projects/builds/_build.html.haml_spec.rb
spec/views/projects/builds/_build.html.haml_spec.rb
+28
-0
spec/views/projects/builds/_generic_commit_status.html.haml_spec.rb
.../projects/builds/_generic_commit_status.html.haml_spec.rb
+28
-0
No files found.
spec/views/projects/builds/_build.html.haml_spec.rb
0 → 100644
View file @
d55fb906
require
'spec_helper'
describe
'projects/ci/builds/_build'
do
include
Devise
::
Test
::
ControllerHelpers
let
(
:project
)
{
create
(
:project
)
}
let
(
:pipeline
)
{
create
(
:ci_empty_pipeline
,
id:
1337
,
project:
project
,
sha:
project
.
commit
.
id
)
}
let
(
:build
)
{
create
(
:ci_build
,
pipeline:
pipeline
,
stage:
'test'
,
stage_idx:
1
,
name:
'rspec 0:2'
,
status: :pending
)
}
before
do
controller
.
prepend_view_path
(
'app/views/projects'
)
allow
(
view
).
to
receive
(
:can?
).
and_return
(
true
)
end
it
'won\'t include a column with a link to its pipeline by default'
do
render
partial:
'projects/ci/builds/build'
,
locals:
{
build:
build
}
expect
(
rendered
).
not_to
have_link
(
'#1337'
)
expect
(
rendered
).
not_to
have_text
(
'#1337 by API'
)
end
it
'can include a column with a link to its pipeline'
do
render
partial:
'projects/ci/builds/build'
,
locals:
{
build:
build
,
pipeline_link:
true
}
expect
(
rendered
).
to
have_link
(
'#1337'
)
expect
(
rendered
).
to
have_text
(
'#1337 by API'
)
end
end
spec/views/projects/builds/_generic_commit_status.html.haml_spec.rb
0 → 100644
View file @
d55fb906
require
'spec_helper'
describe
'projects/generic_commit_statuses/_generic_commit_status.html.haml'
do
include
Devise
::
Test
::
ControllerHelpers
let
(
:project
)
{
create
(
:project
)
}
let
(
:pipeline
)
{
create
(
:ci_empty_pipeline
,
id:
1337
,
project:
project
,
sha:
project
.
commit
.
id
)
}
let
(
:generic_commit_status
)
{
create
(
:generic_commit_status
,
pipeline:
pipeline
,
stage:
'external'
,
name:
'jenkins'
,
stage_idx:
3
)
}
before
do
controller
.
prepend_view_path
(
'app/views/projects'
)
allow
(
view
).
to
receive
(
:can?
).
and_return
(
true
)
end
it
'won\'t include a column with a link to its pipeline by default'
do
render
partial:
'projects/generic_commit_statuses/generic_commit_status'
,
locals:
{
generic_commit_status:
generic_commit_status
}
expect
(
rendered
).
not_to
have_link
(
'#1337'
)
expect
(
rendered
).
not_to
have_text
(
'#1337 by API'
)
end
it
'can include a column with a link to its pipeline'
do
render
partial:
'projects/generic_commit_statuses/generic_commit_status'
,
locals:
{
generic_commit_status:
generic_commit_status
,
pipeline_link:
true
}
expect
(
rendered
).
to
have_link
(
'#1337'
)
expect
(
rendered
).
to
have_text
(
'#1337 by API'
)
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