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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
ac5b3ce0
Commit
ac5b3ce0
authored
Jan 27, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add controller tests for commit pipelines endpoint
parent
30c73d2d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
5 deletions
+19
-5
spec/controllers/projects/commit_controller_spec.rb
spec/controllers/projects/commit_controller_spec.rb
+19
-5
No files found.
spec/controllers/projects/commit_controller_spec.rb
View file @
ac5b3ce0
...
...
@@ -4,7 +4,6 @@ describe Projects::CommitController do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:commit
)
{
project
.
commit
(
"master"
)
}
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
,
commit:
commit
)
}
let
(
:master_pickable_sha
)
{
'7d3b0f7cff5f37573aea97cebfd5692ea1689924'
}
let
(
:master_pickable_commit
)
{
project
.
commit
(
master_pickable_sha
)
}
...
...
@@ -322,11 +321,26 @@ describe Projects::CommitController do
end
context
'when the commit exists'
do
context
'when the commit has one or more pipelines'
do
it
'shows pipelines'
do
get_pipelines
(
id:
commit
.
id
)
context
'when the commit has pipelines'
do
before
do
create
(
:ci_pipeline
,
project:
project
,
sha:
commit
.
id
)
end
context
'when rendering a HTML format'
do
it
'shows pipelines'
do
get_pipelines
(
id:
commit
.
id
)
expect
(
response
).
to
be_ok
end
end
expect
(
response
).
to
be_ok
context
'when rendering a JSON format'
do
it
'responds with serialized pipelines'
do
get_pipelines
(
id:
commit
.
id
,
format: :json
)
expect
(
response
).
to
be_ok
expect
(
JSON
.
parse
(
response
.
body
)).
not_to
be_empty
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