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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
4254f09e
Commit
4254f09e
authored
Jun 16, 2015
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return 40x error codes if branch could not be deleted in UI
parent
e2190115
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
2 deletions
+29
-2
CHANGELOG
CHANGELOG
+1
-0
app/controllers/projects/branches_controller.rb
app/controllers/projects/branches_controller.rb
+2
-2
spec/controllers/branches_controller_spec.rb
spec/controllers/branches_controller_spec.rb
+26
-0
No files found.
CHANGELOG
View file @
4254f09e
...
...
@@ -20,6 +20,7 @@ v 7.13.0 (unreleased)
- Update maintenance documentation to explain no need to recompile asssets for omnibus installations (Stan Hu)
- Support commenting on diffs in side-by-side mode (Stan Hu)
- Fix JavaScript error when clicking on the comment button on a diff line that has a comment already (Stan Hu)
- Return 40x error codes if branch could not be deleted in UI (Stan Hu)
- Remove project visibility icons from dashboard projects list
- Rename "Design" profile settings page to "Preferences".
- Allow users to customize their default Dashboard page.
...
...
app/controllers/projects/branches_controller.rb
View file @
4254f09e
...
...
@@ -32,7 +32,7 @@ class Projects::BranchesController < Projects::ApplicationController
end
def
destroy
DeleteBranchService
.
new
(
project
,
current_user
).
execute
(
params
[
:id
])
status
=
DeleteBranchService
.
new
(
project
,
current_user
).
execute
(
params
[
:id
])
@branch_name
=
params
[
:id
]
respond_to
do
|
format
|
...
...
@@ -40,7 +40,7 @@ class Projects::BranchesController < Projects::ApplicationController
redirect_to
namespace_project_branches_path
(
@project
.
namespace
,
@project
)
end
format
.
js
format
.
js
{
render
status:
status
[
:return_code
]
}
end
end
end
spec/controllers/branches_controller_spec.rb
View file @
4254f09e
...
...
@@ -55,4 +55,30 @@ describe Projects::BranchesController do
it
{
is_expected
.
to
render_template
(
'new'
)
}
end
end
describe
"POST destroy"
do
render_views
before
do
post
:destroy
,
format: :js
,
id:
branch
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
.
to_param
end
context
"valid branch name, valid source"
do
let
(
:branch
)
{
"feature"
}
it
{
expect
(
response
.
status
).
to
eq
(
200
)
}
it
{
expect
(
subject
).
to
render_template
(
'destroy'
)
}
end
context
"invalid branch name, valid ref"
do
let
(
:branch
)
{
"no-branch"
}
it
{
expect
(
response
.
status
).
to
eq
(
404
)
}
it
{
expect
(
subject
).
to
render_template
(
'destroy'
)
}
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