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
3b1fafd7
Commit
3b1fafd7
authored
Dec 02, 2016
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve conflicts
parent
6744c42a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
30 deletions
+4
-30
app/models/concerns/protected_branch_access.rb
app/models/concerns/protected_branch_access.rb
+0
-3
app/models/protected_branch/merge_access_level.rb
app/models/protected_branch/merge_access_level.rb
+0
-17
spec/mailers/notify_spec.rb
spec/mailers/notify_spec.rb
+3
-3
spec/services/projects/destroy_service_spec.rb
spec/services/projects/destroy_service_spec.rb
+1
-7
No files found.
app/models/concerns/protected_branch_access.rb
View file @
3b1fafd7
...
...
@@ -2,17 +2,14 @@ module ProtectedBranchAccess
extend
ActiveSupport
::
Concern
included
do
<<<<<<<
HEAD
validates_uniqueness_of
:group_id
,
scope: :protected_branch
,
allow_nil:
true
validates_uniqueness_of
:user_id
,
scope: :protected_branch
,
allow_nil:
true
validates_uniqueness_of
:access_level
,
scope: :protected_branch
,
unless:
Proc
.
new
{
|
access_level
|
access_level
.
user_id?
||
access_level
.
group_id?
},
conditions:
->
{
where
(
user_id:
nil
,
group_id:
nil
)
}
=======
belongs_to
:protected_branch
delegate
:project
,
to: :protected_branch
>>>>>>>
14046
b9c734e5e6506d63276f39f3f9d770c3699
scope
:master
,
->
{
where
(
access_level:
Gitlab
::
Access
::
MASTER
)
}
scope
:developer
,
->
{
where
(
access_level:
Gitlab
::
Access
::
DEVELOPER
)
}
...
...
app/models/protected_branch/merge_access_level.rb
View file @
3b1fafd7
class
ProtectedBranch::MergeAccessLevel
<
ActiveRecord
::
Base
include
ProtectedBranchAccess
<<<<<<<
HEAD
belongs_to
:protected_branch
belongs_to
:user
belongs_to
:group
delegate
:project
,
to: :protected_branch
=======
>>>>>>>
14046
b9c734e5e6506d63276f39f3f9d770c3699
validates
:access_level
,
presence:
true
,
inclusion:
{
in:
[
Gitlab
::
Access
::
MASTER
,
Gitlab
::
Access
::
DEVELOPER
]
}
...
...
@@ -22,15 +16,4 @@ class ProtectedBranch::MergeAccessLevel < ActiveRecord::Base
Gitlab
::
Access
::
DEVELOPER
=>
"Developers + Masters"
}.
with_indifferent_access
end
<<<<<<<
HEAD
def
check_access
(
user
)
return
true
if
user
.
is_admin?
return
user
.
id
==
self
.
user_id
if
self
.
user
.
present?
return
group
.
users
.
exists?
(
user
.
id
)
if
self
.
group
.
present?
project
.
team
.
max_member_access
(
user
.
id
)
>=
access_level
end
=======
>>>>>>>
14046
b9c734e5e6506d63276f39f3f9d770c3699
end
spec/mailers/notify_spec.rb
View file @
3b1fafd7
...
...
@@ -1232,7 +1232,6 @@ describe Notify do
end
end
<<<<<<<
HEAD
describe
'admin notification'
do
let
(
:example_site_path
)
{
root_path
}
let
(
:user
)
{
create
(
:user
)
}
...
...
@@ -1256,7 +1255,9 @@ describe Notify do
it
'includes unsubscribe link'
do
unsubscribe_link
=
"http://localhost/unsubscribes/
#{
Base64
.
urlsafe_encode64
(
user
.
email
)
}
"
should
have_body_text
(
unsubscribe_link
)
=======
end
end
describe
'HTML emails setting'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:user
)
{
create
(
:user
)
}
...
...
@@ -1288,7 +1289,6 @@ describe Notify do
match
do
|
actual
|
actual
.
body
.
parts
.
any?
{
|
part
|
part
.
content_type
.
try
(
:match
,
%r(
#{
expected
}
)
)
}
end
>>>>>>>
14046
b9c734e5e6506d63276f39f3f9d770c3699
end
end
end
spec/services/projects/destroy_service_spec.rb
View file @
3b1fafd7
...
...
@@ -21,11 +21,6 @@ describe Projects::DestroyService, services: true do
Sidekiq
::
Testing
.
inline!
{
destroy_project
(
project
,
user
,
{})
}
end
<<<<<<<
HEAD
it
{
expect
(
Project
.
all
).
not_to
include
(
project
)
}
it
{
expect
(
Dir
.
exist?
(
path
)).
to
be_falsey
}
it
{
expect
(
Dir
.
exist?
(
remove_path
)).
to
be_falsey
}
context
'when has remote mirrors'
do
let!
(
:project
)
do
create
(
:project
,
namespace:
user
.
namespace
).
tap
do
|
project
|
...
...
@@ -38,9 +33,8 @@ describe Projects::DestroyService, services: true do
expect
(
RemoteMirror
.
count
).
to
eq
(
0
)
end
end
=======
it_behaves_like
'deleting the project'
>>>>>>>
14046
b9c734e5e6506d63276f39f3f9d770c3699
end
context
'Sidekiq fake'
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