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
742dd303
Commit
742dd303
authored
Apr 24, 2018
by
Bob Van Landuyt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve conflicts in `spec/models/project_spec.rb` | take 2
parent
3ad47965
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
46 deletions
+0
-46
spec/models/project_spec.rb
spec/models/project_spec.rb
+0
-46
No files found.
spec/models/project_spec.rb
View file @
742dd303
...
@@ -1647,52 +1647,6 @@ describe Project do
...
@@ -1647,52 +1647,6 @@ describe Project do
end
end
end
end
describe
'#user_can_push_to_empty_repo?'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:user
)
{
create
(
:user
)
}
it
'returns false when default_branch_protection is in full protection and user is developer'
do
project
.
add_developer
(
user
)
stub_application_setting
(
default_branch_protection:
Gitlab
::
Access
::
PROTECTION_FULL
)
expect
(
project
.
user_can_push_to_empty_repo?
(
user
)).
to
be_falsey
end
it
'returns false when default_branch_protection only lets devs merge and user is dev'
do
project
.
add_developer
(
user
)
stub_application_setting
(
default_branch_protection:
Gitlab
::
Access
::
PROTECTION_DEV_CAN_MERGE
)
expect
(
project
.
user_can_push_to_empty_repo?
(
user
)).
to
be_falsey
end
it
'returns true when default_branch_protection lets devs push and user is developer'
do
project
.
add_developer
(
user
)
stub_application_setting
(
default_branch_protection:
Gitlab
::
Access
::
PROTECTION_DEV_CAN_PUSH
)
expect
(
project
.
user_can_push_to_empty_repo?
(
user
)).
to
be_truthy
end
it
'returns true when default_branch_protection is unprotected and user is developer'
do
project
.
add_developer
(
user
)
stub_application_setting
(
default_branch_protection:
Gitlab
::
Access
::
PROTECTION_NONE
)
expect
(
project
.
user_can_push_to_empty_repo?
(
user
)).
to
be_truthy
end
it
'returns true when user is master'
do
project
.
add_master
(
user
)
expect
(
project
.
user_can_push_to_empty_repo?
(
user
)).
to
be_truthy
end
it
'returns false when the repo is not empty'
do
project
.
add_master
(
user
)
expect
(
project
).
to
receive
(
:empty_repo?
).
and_return
(
false
)
expect
(
project
.
user_can_push_to_empty_repo?
(
user
)).
to
be_falsey
end
end
describe
'#container_registry_url'
do
describe
'#container_registry_url'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
)
}
...
...
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