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
......@@ -6,8 +6,8 @@
let(:user2) { create(:user) }
before do
project.add_master(user)
project.add_master(user2)
project.add_maintainer(user)
project.add_maintainer(user2)
end
describe 'GET #index' do
......@@ -291,7 +291,7 @@ def update_snippet(snippet_params = {}, additional_params = {})
def mark_as_spam
admin = create(:admin)
create(:user_agent_detail, subject: snippet)
project.add_master(admin)
project.add_maintainer(admin)
sign_in(admin)
post :mark_as_spam,
......
......@@ -13,7 +13,7 @@
end
before do
project.add_user(user, Gitlab::Access::MASTER)
project.add_user(user, Gitlab::Access::MAINTAINER)
project.repository.create_file(user, file_path_1, 'something valid',
message: 'test 3', branch_name: 'master')
end
......
......@@ -7,7 +7,7 @@
before do
sign_in(user)
project.add_master(user)
project.add_maintainer(user)
controller.instance_variable_set(:@project, project)
end
......
......@@ -6,7 +6,7 @@
before do
sign_in(user)
project.add_master(user)
project.add_maintainer(user)
end
describe 'GET #show' do
......
......@@ -759,7 +759,7 @@ def update_project(**parameters)
before do
sign_in(user)
project.add_master(user)
project.add_maintainer(user)
end
context 'when project export is enabled' do
......@@ -787,7 +787,7 @@ def update_project(**parameters)
before do
sign_in(user)
project.add_master(user)
project.add_maintainer(user)
end
context 'object storage disabled' do
......@@ -847,7 +847,7 @@ def update_project(**parameters)
before do
sign_in(user)
project.add_master(user)
project.add_maintainer(user)
end
context 'when project export is enabled' do
......@@ -875,7 +875,7 @@ def update_project(**parameters)
before do
sign_in(user)
project.add_master(user)
project.add_maintainer(user)
end
context 'when project export is enabled' do
......
......@@ -269,13 +269,13 @@
context "when the user has access to the project" do
before do
project.add_master(user)
project.add_maintainer(user)
end
context "when the user is blocked" do
before do
user.block
project.add_master(user)
project.add_maintainer(user)
end
it "redirects to the sign in page" do
......@@ -475,13 +475,13 @@
context "when the user has access to the project" do
before do
project.add_master(user)
project.add_maintainer(user)
end
context "when the user is blocked" do
before do
user.block
project.add_master(user)
project.add_maintainer(user)
end
it "redirects to the sign in page" do
......
......@@ -7,7 +7,7 @@
trait(:guest) { access_level GroupMember::GUEST }
trait(:reporter) { access_level GroupMember::REPORTER }
trait(:developer) { access_level GroupMember::DEVELOPER }
trait(:master) { access_level GroupMember::MASTER }
trait(:maintainer) { access_level GroupMember::MAINTAINER }
trait(:owner) { access_level GroupMember::OWNER }
trait(:access_request) { requested_at Time.now }
......
......@@ -2,12 +2,12 @@
factory :project_member do
user
project
master
maintainer
trait(:guest) { access_level ProjectMember::GUEST }
trait(:reporter) { access_level ProjectMember::REPORTER }
trait(:developer) { access_level ProjectMember::DEVELOPER }
trait(:master) { access_level ProjectMember::MASTER }
trait(:maintainer) { access_level ProjectMember::MAINTAINER }
trait(:access_request) { requested_at Time.now }
trait(:invited) do
......
......@@ -47,7 +47,7 @@
# user have access to the project. Our specs don't use said service class,
# thus we must manually refresh things here.
unless project.group || project.pending_delete
project.add_master(project.owner)
project.add_maintainer(project.owner)
end
project.group&.refresh_members_authorized_projects
......
......@@ -39,23 +39,23 @@
end
end
trait :masters_can_push do
trait :maintainers_can_push do
transient do
default_push_level false
end
after(:build) do |protected_branch|
protected_branch.push_access_levels.new(access_level: Gitlab::Access::MASTER)
protected_branch.push_access_levels.new(access_level: Gitlab::Access::MAINTAINER)
end
end
after(:build) do |protected_branch, evaluator|
if evaluator.default_access_level && evaluator.default_push_level
protected_branch.push_access_levels.new(access_level: Gitlab::Access::MASTER)
protected_branch.push_access_levels.new(access_level: Gitlab::Access::MAINTAINER)
end
if evaluator.default_access_level && evaluator.default_merge_level
protected_branch.merge_access_levels.new(access_level: Gitlab::Access::MASTER)
protected_branch.merge_access_levels.new(access_level: Gitlab::Access::MAINTAINER)
end
end
......
......@@ -27,19 +27,19 @@
end
end
trait :masters_can_create do
trait :maintainers_can_create do
transient do
default_access_level false
end
after(:build) do |protected_tag|
protected_tag.create_access_levels.new(access_level: Gitlab::Access::MASTER)
protected_tag.create_access_levels.new(access_level: Gitlab::Access::MAINTAINER)
end
end
after(:build) do |protected_tag, evaluator|
if evaluator.default_access_level
protected_tag.create_access_levels.new(access_level: Gitlab::Access::MASTER)
protected_tag.create_access_levels.new(access_level: Gitlab::Access::MAINTAINER)
end
end
end
......
......@@ -168,7 +168,7 @@
it 'renders shared project' do
empty_project = create(:project)
empty_project.project_group_links.create!(
group_access: Gitlab::Access::MASTER,
group_access: Gitlab::Access::MAINTAINER,
group: group
)
......
......@@ -88,7 +88,7 @@
describe 'add admin himself to a project' do
before do
project.add_master(user)
project.add_maintainer(user)
end
it 'adds admin a to a project as developer', :js do
......@@ -110,7 +110,7 @@
describe 'admin remove himself from a project' do
before do
project.add_master(user)
project.add_maintainer(user)
project.add_developer(current_user)
end
......
......@@ -8,8 +8,8 @@
let!(:project2) { create(:project) }
before do
project1.add_master(user)
project2.add_master(user)
project1.add_maintainer(user)
project2.add_maintainer(user)
end
describe "atom feed" do
......
......@@ -26,7 +26,7 @@
let(:note) { create(:note, noteable: issue, author: user, note: 'Bug confirmed', project: project) }
before do
project.add_master(user)
project.add_maintainer(user)
issue_event(issue, user)
note_event(note, user)
visit dashboard_projects_path(:atom, feed_token: user.feed_token)
......
......@@ -47,7 +47,7 @@
let!(:push_event_payload) { create(:push_event_payload, event: push_event) }
before do
project.add_master(user)
project.add_maintainer(user)
issue_event(issue, user)
note_event(note, user)
merge_request_event(merge_request, user)
......
......@@ -12,7 +12,7 @@
let!(:issue2) { create(:issue, project: project, title: 'hij', description: 'klm') }
before do
project.add_master(user)
project.add_maintainer(user)
sign_in(user)
......
......@@ -11,8 +11,8 @@
let!(:user2) { create(:user) }
before do
project.add_master(user)
project.add_master(user2)
project.add_maintainer(user)
project.add_maintainer(user2)
set_cookie('sidebar_collapsed', 'true')
......
......@@ -13,7 +13,7 @@
let!(:issue3) { create(:labeled_issue, project: project, title: 'testing 3', labels: [label], relative_position: 1) }
before do
project.add_master(user)
project.add_maintainer(user)
sign_in(user)
end
......
......@@ -10,7 +10,7 @@
let!(:issue1) { create(:issue, project: project) }
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