BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
ae8a0665
Commit
ae8a0665
authored
Mar 06, 2017
by
Sean McGivern
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '28898-fix-search-branches-in-cherry-picking' into 'master'
Fix json response in branches controller Closes #28898 See merge request !9710
parents
633aaf2b
905a2993
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
1 deletion
+28
-1
branches_controller.rb
app/controllers/projects/branches_controller.rb
+1
-1
28898-fix-search-branches-in-cherry-picking.yml
...nreleased/28898-fix-search-branches-in-cherry-picking.yml
+4
-0
branches_controller_spec.rb
spec/controllers/projects/branches_controller_spec.rb
+23
-0
No files found.
app/controllers/projects/branches_controller.rb
View file @
ae8a0665
...
...
@@ -20,7 +20,7 @@ class Projects::BranchesController < Projects::ApplicationController
respond_to
do
|
format
|
format
.
html
format
.
json
do
render
json:
@
repository
.
branch_names
render
json:
@
branches
.
map
(
&
:name
)
end
end
end
...
...
changelogs/unreleased/28898-fix-search-branches-in-cherry-picking.yml
0 → 100644
View file @
ae8a0665
---
title
:
Fix json response in branches controller
merge_request
:
9710
author
:
George Andrinopoulos
spec/controllers/projects/branches_controller_spec.rb
View file @
ae8a0665
...
...
@@ -244,4 +244,27 @@ describe Projects::BranchesController do
end
end
end
describe
"GET index"
do
render_views
before
do
sign_in
(
user
)
end
context
'when rendering a JSON format'
do
it
'filters branches by name'
do
get
:index
,
namespace_id:
project
.
namespace
,
project_id:
project
,
format: :json
,
search:
'master'
parsed_response
=
JSON
.
parse
(
response
.
body
)
expect
(
parsed_response
.
length
).
to
eq
1
expect
(
parsed_response
.
first
).
to
eq
'master'
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