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
bbe8a16f
Commit
bbe8a16f
authored
Jun 10, 2020
by
Lee Tickett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clarify developer/user
parent
e4414cca
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
14 deletions
+13
-14
spec/controllers/projects/branches_controller_spec.rb
spec/controllers/projects/branches_controller_spec.rb
+13
-14
No files found.
spec/controllers/projects/branches_controller_spec.rb
View file @
bbe8a16f
...
...
@@ -8,8 +8,7 @@ RSpec.describe Projects::BranchesController do
let
(
:developer
)
{
create
(
:user
)
}
before
do
project
.
add_maintainer
(
user
)
project
.
add_developer
(
user
)
project
.
add_developer
(
developer
)
allow
(
project
).
to
receive
(
:branches
).
and_return
([
'master'
,
'foo/bar/baz'
])
allow
(
project
).
to
receive
(
:tags
).
and_return
([
'v1.0.0'
,
'v2.0.0'
])
...
...
@@ -21,7 +20,7 @@ RSpec.describe Projects::BranchesController do
context
"on creation of a new branch"
do
before
do
sign_in
(
us
er
)
sign_in
(
develop
er
)
post
:create
,
params:
{
...
...
@@ -80,7 +79,7 @@ RSpec.describe Projects::BranchesController do
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
before
do
sign_in
(
us
er
)
sign_in
(
develop
er
)
end
it
'redirects'
do
...
...
@@ -97,7 +96,7 @@ RSpec.describe Projects::BranchesController do
end
it
'posts a system note'
do
expect
(
SystemNoteService
).
to
receive
(
:new_issue_branch
).
with
(
issue
,
project
,
us
er
,
"1-feature-branch"
,
branch_project:
project
)
expect
(
SystemNoteService
).
to
receive
(
:new_issue_branch
).
with
(
issue
,
project
,
develop
er
,
"1-feature-branch"
,
branch_project:
project
)
post
:create
,
params:
{
...
...
@@ -136,14 +135,14 @@ RSpec.describe Projects::BranchesController do
context
'user can update issue'
do
before
do
confidential_issue_project
.
add_reporter
(
us
er
)
confidential_issue_project
.
add_reporter
(
develop
er
)
end
context
'issue is under the specified project'
do
let
(
:issue
)
{
create
(
:issue
,
project:
confidential_issue_project
)
}
it
'posts a system note'
do
expect
(
SystemNoteService
).
to
receive
(
:new_issue_branch
).
with
(
issue
,
confidential_issue_project
,
us
er
,
"1-feature-branch"
,
branch_project:
project
)
expect
(
SystemNoteService
).
to
receive
(
:new_issue_branch
).
with
(
issue
,
confidential_issue_project
,
develop
er
,
"1-feature-branch"
,
branch_project:
project
)
create_branch_with_confidential_issue_project
end
...
...
@@ -264,7 +263,7 @@ RSpec.describe Projects::BranchesController do
describe
'POST create with JSON format'
do
before
do
sign_in
(
us
er
)
sign_in
(
develop
er
)
end
context
'with valid params'
do
...
...
@@ -305,7 +304,7 @@ RSpec.describe Projects::BranchesController do
render_views
before
do
sign_in
(
us
er
)
sign_in
(
develop
er
)
end
it
'returns 303'
do
...
...
@@ -325,7 +324,7 @@ RSpec.describe Projects::BranchesController do
render_views
before
do
sign_in
(
us
er
)
sign_in
(
develop
er
)
post
:destroy
,
format:
format
,
...
...
@@ -436,7 +435,7 @@ RSpec.describe Projects::BranchesController do
context
'when user is allowed to push'
do
before
do
sign_in
(
us
er
)
sign_in
(
develop
er
)
end
it
'redirects to branches'
do
...
...
@@ -454,7 +453,7 @@ RSpec.describe Projects::BranchesController do
context
'when user is not allowed to push'
do
before
do
sign_in
(
develop
er
)
sign_in
(
us
er
)
end
it
'responds with status 404'
do
...
...
@@ -469,7 +468,7 @@ RSpec.describe Projects::BranchesController do
render_views
before
do
sign_in
(
us
er
)
sign_in
(
develop
er
)
end
context
'when rendering a JSON format'
do
...
...
@@ -564,7 +563,7 @@ RSpec.describe Projects::BranchesController do
describe
'GET diverging_commit_counts'
do
before
do
sign_in
(
us
er
)
sign_in
(
develop
er
)
end
it
'returns the commit counts behind and ahead of default branch'
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