Commit 3b1fafd7 authored by Valery Sizov's avatar Valery Sizov

Resolve conflicts

parent 6744c42a
......@@ -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
>>>>>>> 14046b9c734e5e6506d63276f39f3f9d770c3699
scope :master, -> { where(access_level: Gitlab::Access::MASTER) }
scope :developer, -> { where(access_level: Gitlab::Access::DEVELOPER) }
......
class ProtectedBranch::MergeAccessLevel < ActiveRecord::Base
include ProtectedBranchAccess
<<<<<<< HEAD
belongs_to :protected_branch
belongs_to :user
belongs_to :group
delegate :project, to: :protected_branch
=======
>>>>>>> 14046b9c734e5e6506d63276f39f3f9d770c3699
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
=======
>>>>>>> 14046b9c734e5e6506d63276f39f3f9d770c3699
end
......@@ -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
>>>>>>> 14046b9c734e5e6506d63276f39f3f9d770c3699
end
end
end
......@@ -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'
>>>>>>> 14046b9c734e5e6506d63276f39f3f9d770c3699
end
context 'Sidekiq fake' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment