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
Show 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
...
@@ -8,8 +8,7 @@ RSpec.describe Projects::BranchesController do
let
(
:developer
)
{
create
(
:user
)
}
let
(
:developer
)
{
create
(
:user
)
}
before
do
before
do
project
.
add_maintainer
(
user
)
project
.
add_developer
(
developer
)
project
.
add_developer
(
user
)
allow
(
project
).
to
receive
(
:branches
).
and_return
([
'master'
,
'foo/bar/baz'
])
allow
(
project
).
to
receive
(
:branches
).
and_return
([
'master'
,
'foo/bar/baz'
])
allow
(
project
).
to
receive
(
:tags
).
and_return
([
'v1.0.0'
,
'v2.0.0'
])
allow
(
project
).
to
receive
(
:tags
).
and_return
([
'v1.0.0'
,
'v2.0.0'
])
...
@@ -21,7 +20,7 @@ RSpec.describe Projects::BranchesController do
...
@@ -21,7 +20,7 @@ RSpec.describe Projects::BranchesController do
context
"on creation of a new branch"
do
context
"on creation of a new branch"
do
before
do
before
do
sign_in
(
us
er
)
sign_in
(
develop
er
)
post
:create
,
post
:create
,
params:
{
params:
{
...
@@ -80,7 +79,7 @@ RSpec.describe Projects::BranchesController do
...
@@ -80,7 +79,7 @@ RSpec.describe Projects::BranchesController do
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
before
do
before
do
sign_in
(
us
er
)
sign_in
(
develop
er
)
end
end
it
'redirects'
do
it
'redirects'
do
...
@@ -97,7 +96,7 @@ RSpec.describe Projects::BranchesController do
...
@@ -97,7 +96,7 @@ RSpec.describe Projects::BranchesController do
end
end
it
'posts a system note'
do
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
,
post
:create
,
params:
{
params:
{
...
@@ -136,14 +135,14 @@ RSpec.describe Projects::BranchesController do
...
@@ -136,14 +135,14 @@ RSpec.describe Projects::BranchesController do
context
'user can update issue'
do
context
'user can update issue'
do
before
do
before
do
confidential_issue_project
.
add_reporter
(
us
er
)
confidential_issue_project
.
add_reporter
(
develop
er
)
end
end
context
'issue is under the specified project'
do
context
'issue is under the specified project'
do
let
(
:issue
)
{
create
(
:issue
,
project:
confidential_issue_project
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
confidential_issue_project
)
}
it
'posts a system note'
do
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
create_branch_with_confidential_issue_project
end
end
...
@@ -264,7 +263,7 @@ RSpec.describe Projects::BranchesController do
...
@@ -264,7 +263,7 @@ RSpec.describe Projects::BranchesController do
describe
'POST create with JSON format'
do
describe
'POST create with JSON format'
do
before
do
before
do
sign_in
(
us
er
)
sign_in
(
develop
er
)
end
end
context
'with valid params'
do
context
'with valid params'
do
...
@@ -305,7 +304,7 @@ RSpec.describe Projects::BranchesController do
...
@@ -305,7 +304,7 @@ RSpec.describe Projects::BranchesController do
render_views
render_views
before
do
before
do
sign_in
(
us
er
)
sign_in
(
develop
er
)
end
end
it
'returns 303'
do
it
'returns 303'
do
...
@@ -325,7 +324,7 @@ RSpec.describe Projects::BranchesController do
...
@@ -325,7 +324,7 @@ RSpec.describe Projects::BranchesController do
render_views
render_views
before
do
before
do
sign_in
(
us
er
)
sign_in
(
develop
er
)
post
:destroy
,
post
:destroy
,
format:
format
,
format:
format
,
...
@@ -436,7 +435,7 @@ RSpec.describe Projects::BranchesController do
...
@@ -436,7 +435,7 @@ RSpec.describe Projects::BranchesController do
context
'when user is allowed to push'
do
context
'when user is allowed to push'
do
before
do
before
do
sign_in
(
us
er
)
sign_in
(
develop
er
)
end
end
it
'redirects to branches'
do
it
'redirects to branches'
do
...
@@ -454,7 +453,7 @@ RSpec.describe Projects::BranchesController do
...
@@ -454,7 +453,7 @@ RSpec.describe Projects::BranchesController do
context
'when user is not allowed to push'
do
context
'when user is not allowed to push'
do
before
do
before
do
sign_in
(
develop
er
)
sign_in
(
us
er
)
end
end
it
'responds with status 404'
do
it
'responds with status 404'
do
...
@@ -469,7 +468,7 @@ RSpec.describe Projects::BranchesController do
...
@@ -469,7 +468,7 @@ RSpec.describe Projects::BranchesController do
render_views
render_views
before
do
before
do
sign_in
(
us
er
)
sign_in
(
develop
er
)
end
end
context
'when rendering a JSON format'
do
context
'when rendering a JSON format'
do
...
@@ -564,7 +563,7 @@ RSpec.describe Projects::BranchesController do
...
@@ -564,7 +563,7 @@ RSpec.describe Projects::BranchesController do
describe
'GET diverging_commit_counts'
do
describe
'GET diverging_commit_counts'
do
before
do
before
do
sign_in
(
us
er
)
sign_in
(
develop
er
)
end
end
it
'returns the commit counts behind and ahead of default branch'
do
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