This instance was upgraded to Heptapod 0.27.2 on 2021-12-08 at 22:00 UTC+1

Commit e22d200a authored by Mark Chao's avatar Mark Chao Committed by Dmitriy Zaporozhets
Browse files

Resolve "Rename the `Master` role to `Maintainer`" Backend

parent 2649cbe0cb26
......@@ -695,7 +695,7 @@ def post_new_issue(issue_attrs = {}, additional_params = {})
let(:project) { merge_request.source_project }
before do
project.add_master(user)
project.add_maintainer(user)
sign_in user
end
......@@ -869,7 +869,7 @@ def post_verified_issue
def post_spam
admin = create(:admin)
create(:user_agent_detail, subject: issue)
project.add_master(admin)
project.add_maintainer(admin)
sign_in(admin)
post :mark_as_spam, {
namespace_id: project.namespace,
......
......@@ -431,7 +431,7 @@ def post_cancel_all
end
describe 'POST erase' do
let(:role) { :master }
let(:role) { :maintainer }
before do
project.add_role(user, role)
......
......@@ -6,7 +6,7 @@
let(:user) { create(:user) }
before do
project.add_master(user)
project.add_maintainer(user)
sign_in(user)
end
......
......@@ -5,7 +5,7 @@
let!(:user) { create(:user) }
before do
project.add_master(user)
project.add_maintainer(user)
sign_in(user)
end
......
......@@ -16,7 +16,7 @@
end
before do
fork_project.add_master(user)
fork_project.add_maintainer(user)
Projects::ForkService.new(project, user).execute(fork_project)
sign_in(user)
end
......@@ -94,7 +94,7 @@ def diff_for_path(extra_params = {})
let(:other_project) { create(:project, :repository) }
before do
other_project.add_master(user)
other_project.add_maintainer(user)
end
context 'when the path exists in the diff' do
......
......@@ -140,7 +140,7 @@ def diff_for_path(extra_params = {})
let(:other_project) { create(:project) }
before do
other_project.add_master(user)
other_project.add_maintainer(user)
diff_for_path(old_path: existing_path, new_path: existing_path, project_id: other_project)
end
......
......@@ -11,7 +11,7 @@
before do
sign_in(user)
project.add_master(user)
project.add_maintainer(user)
controller.instance_variable_set(:@project, project)
end
......
......@@ -14,7 +14,7 @@
before do
allow(Gitlab.config.pages).to receive(:enabled).and_return(true)
sign_in(user)
project.add_master(user)
project.add_maintainer(user)
end
describe 'GET show' do
......
......@@ -19,7 +19,7 @@
before do
allow(Gitlab.config.pages).to receive(:enabled).and_return(true)
sign_in(user)
project.add_master(user)
project.add_maintainer(user)
end
describe 'GET show' do
......
......@@ -121,7 +121,7 @@ def visit_pipelines_schedules
it { expect { go }.to be_allowed_for(:admin) }
it { expect { go }.to be_allowed_for(:owner).of(project) }
it { expect { go }.to be_allowed_for(:master).of(project) }
it { expect { go }.to be_allowed_for(:maintainer).of(project) }
it { expect { go }.to be_allowed_for(:developer).of(project) }
it { expect { go }.to be_denied_for(:reporter).of(project) }
it { expect { go }.to be_denied_for(:guest).of(project) }
......@@ -274,7 +274,7 @@ def go
it { expect { go }.to be_allowed_for(:admin) }
it { expect { go }.to be_allowed_for(:owner).of(project) }
it { expect { go }.to be_allowed_for(:master).of(project) }
it { expect { go }.to be_allowed_for(:maintainer).of(project) }
it { expect { go }.to be_allowed_for(:developer).of(project).own(pipeline_schedule) }
it { expect { go }.to be_denied_for(:reporter).of(project) }
it { expect { go }.to be_denied_for(:guest).of(project) }
......@@ -292,19 +292,19 @@ def go
it { expect { go }.to be_allowed_for(developer_1) }
it { expect { go }.to be_denied_for(:developer).of(project) }
it { expect { go }.to be_allowed_for(:master).of(project) }
it { expect { go }.to be_allowed_for(:maintainer).of(project) }
end
context 'when a master created a pipeline schedule' do
let(:master_1) { create(:user) }
let!(:pipeline_schedule) { create(:ci_pipeline_schedule, project: project, owner: master_1) }
context 'when a maintainer created a pipeline schedule' do
let(:maintainer_1) { create(:user) }
let!(:pipeline_schedule) { create(:ci_pipeline_schedule, project: project, owner: maintainer_1) }
before do
project.add_master(master_1)
project.add_maintainer(maintainer_1)
end
it { expect { go }.to be_allowed_for(master_1) }
it { expect { go }.to be_allowed_for(:master).of(project) }
it { expect { go }.to be_allowed_for(maintainer_1) }
it { expect { go }.to be_allowed_for(:maintainer).of(project) }
it { expect { go }.to be_denied_for(:developer).of(project) }
end
end
......@@ -331,7 +331,7 @@ def go
let(:user) { create(:user) }
before do
project.add_master(user)
project.add_maintainer(user)
sign_in(user)
end
......@@ -346,7 +346,7 @@ def go
describe 'security' do
it { expect { go }.to be_allowed_for(:admin) }
it { expect { go }.to be_allowed_for(:owner).of(project) }
it { expect { go }.to be_allowed_for(:master).of(project) }
it { expect { go }.to be_allowed_for(:maintainer).of(project) }
it { expect { go }.to be_allowed_for(:developer).of(project).own(pipeline_schedule) }
it { expect { go }.to be_denied_for(:reporter).of(project) }
it { expect { go }.to be_denied_for(:guest).of(project) }
......@@ -364,7 +364,7 @@ def go
describe 'security' do
it { expect { go }.to be_allowed_for(:admin) }
it { expect { go }.to be_allowed_for(:owner).of(project) }
it { expect { go }.to be_allowed_for(:master).of(project) }
it { expect { go }.to be_allowed_for(:maintainer).of(project) }
it { expect { go }.to be_allowed_for(:developer).of(project).own(pipeline_schedule) }
it { expect { go }.to be_denied_for(:reporter).of(project) }
it { expect { go }.to be_denied_for(:guest).of(project) }
......@@ -453,9 +453,9 @@ def go
end
end
context 'when a master makes the request' do
context 'when a maintainer makes the request' do
before do
project.add_master(user)
project.add_maintainer(user)
sign_in(user)
end
......
......@@ -6,7 +6,7 @@
let(:project) { project_auto_devops.project }
before do
project.add_master(user)
project.add_maintainer(user)
sign_in(user)
end
......
......@@ -37,7 +37,7 @@
context 'when user has enough rights' do
before do
project.add_master(user)
project.add_maintainer(user)
end
it 'adds user to members' do
......@@ -70,7 +70,7 @@
let(:requester) { create(:project_member, :access_request, project: project) }
before do
project.add_master(user)
project.add_maintainer(user)
sign_in(user)
end
......@@ -121,7 +121,7 @@
context 'when user has enough rights' do
before do
project.add_master(user)
project.add_maintainer(user)
end
it '[HTML] removes user from members' do
......@@ -181,7 +181,7 @@
let(:project) { create(:project, namespace: user.namespace) }
before do
project.add_master(user)
project.add_maintainer(user)
end
it 'cannot remove themselves from the project' do
......@@ -263,7 +263,7 @@
context 'when user has enough rights' do
before do
project.add_master(user)
project.add_maintainer(user)
end
it 'adds user to members' do
......@@ -285,7 +285,7 @@
let(:member) { create(:user) }
before do
project.add_master(user)
project.add_maintainer(user)
another_project.add_guest(member)
sign_in(user)
end
......@@ -332,7 +332,7 @@
context 'when creating owner' do
before do
project.add_master(user)
project.add_maintainer(user)
sign_in(user)
end
......@@ -346,9 +346,9 @@
end
end
context 'when create master' do
context 'when create maintainer' do
before do
project.add_master(user)
project.add_maintainer(user)
sign_in(user)
end
......@@ -356,7 +356,7 @@
expect do
post :create, user_ids: stranger.id,
namespace_id: project.namespace,
access_level: Member::MASTER,
access_level: Member::MAINTAINER,
project_id: project
end.to change { project.members.count }.by(1)
end
......
......@@ -7,7 +7,7 @@
let(:prometheus_adapter) { double('prometheus_adapter', can_query?: true) }
before do
project.add_master(user)
project.add_maintainer(user)
sign_in(user)
end
......
......@@ -8,7 +8,7 @@
let(:user) { create(:user) }
before do
project.add_master(user)
project.add_maintainer(user)
end
describe "GET #index" do
......@@ -20,10 +20,10 @@
end
describe "POST #create" do
let(:master_access_level) { [{ access_level: Gitlab::Access::MASTER }] }
let(:maintainer_access_level) { [{ access_level: Gitlab::Access::MAINTAINER }] }
let(:access_level_params) do
{ merge_access_levels_attributes: master_access_level,
push_access_levels_attributes: master_access_level }
{ merge_access_levels_attributes: maintainer_access_level,
push_access_levels_attributes: maintainer_access_level }
end
let(:create_params) { attributes_for(:protected_branch).merge(access_level_params) }
......
......@@ -15,7 +15,7 @@
let(:user) { create(:user) }
before do
project.add_master(user)
project.add_maintainer(user)
sign_in(user)
end
......
......@@ -15,7 +15,7 @@
before do
sign_in(user)
project.add_master(user)
project.add_maintainer(user)
end
describe '#update' do
......
......@@ -9,7 +9,7 @@
before do
sign_in(user)
project.add_master(user)
project.add_maintainer(user)
end
describe '#test' do
......
......@@ -6,7 +6,7 @@
let(:project) { project_auto_devops.project }
before do
project.add_master(user)
project.add_maintainer(user)
sign_in(user)
end
......@@ -27,7 +27,7 @@
let!(:shared_runner) { create(:ci_runner, :instance) }
it 'sets assignable project runners only' do
group.add_master(user)
group.add_maintainer(user)
get :show, namespace_id: project.namespace, project_id: project
......@@ -40,7 +40,7 @@
before do
sign_in(user)
project.add_master(user)
project.add_maintainer(user)
allow(ResetProjectCacheService).to receive_message_chain(:new, :execute).and_return(true)
end
......
......@@ -5,7 +5,7 @@
let(:user) { create(:user) }
before do
project.add_master(user)
project.add_maintainer(user)
sign_in(user)
end
......
......@@ -5,7 +5,7 @@
let(:user) { create(:user) }
before do
project.add_master(user)
project.add_maintainer(user)
sign_in(user)
end
......
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