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
b77d811c
Commit
b77d811c
authored
Apr 19, 2019
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Port EE specific changes to CE
parent
a96507bf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
spec/services/delete_branch_service_spec.rb
spec/services/delete_branch_service_spec.rb
+12
-8
No files found.
spec/services/delete_branch_service_spec.rb
View file @
b77d811c
...
...
@@ -8,20 +8,24 @@ describe DeleteBranchService do
let
(
:user
)
{
create
(
:user
)
}
let
(
:service
)
{
described_class
.
new
(
project
,
user
)
}
shared_examples
'a deleted branch'
do
|
branch_name
|
it
'removes the branch'
do
expect
(
branch_exists?
(
branch_name
)).
to
be
true
result
=
service
.
execute
(
branch_name
)
expect
(
result
.
status
).
to
eq
:success
expect
(
branch_exists?
(
branch_name
)).
to
be
false
end
end
describe
'#execute'
do
context
'when user has access to push to repository'
do
before
do
project
.
add_developer
(
user
)
end
it
'removes the branch'
do
expect
(
branch_exists?
(
'feature'
)).
to
be
true
result
=
service
.
execute
(
'feature'
)
expect
(
result
.
status
).
to
eq
:success
expect
(
branch_exists?
(
'feature'
)).
to
be
false
end
it_behaves_like
'a deleted branch'
,
'feature'
end
context
'when user does not have access to push to repository'
do
...
...
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