diff options
author | Mark Chao <mchao@gitlab.com> | 2018-07-11 14:36:08 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2018-07-11 14:36:08 +0000 |
commit | a63bce1a4b55bc6cbafb9dec12d33028521489e9 (patch) | |
tree | ee9466e6b06536a65d4e851f4096679c6f968d1e /spec/finders | |
parent | 1bf54e092783f7ad388225d32ab79ac1e845559c (diff) | |
download | gitlab-ce-a63bce1a4b55bc6cbafb9dec12d33028521489e9.tar.gz |
Resolve "Rename the `Master` role to `Maintainer`" Backend
Diffstat (limited to 'spec/finders')
-rw-r--r-- | spec/finders/access_requests_finder_spec.rb | 4 | ||||
-rw-r--r-- | spec/finders/admin/projects_finder_spec.rb | 2 | ||||
-rw-r--r-- | spec/finders/concerns/finder_with_cross_project_access_spec.rb | 2 | ||||
-rw-r--r-- | spec/finders/contributed_projects_finder_spec.rb | 4 | ||||
-rw-r--r-- | spec/finders/environments_finder_spec.rb | 2 | ||||
-rw-r--r-- | spec/finders/group_members_finder_spec.rb | 24 | ||||
-rw-r--r-- | spec/finders/group_projects_finder_spec.rb | 14 | ||||
-rw-r--r-- | spec/finders/issues_finder_spec.rb | 2 | ||||
-rw-r--r-- | spec/finders/joined_groups_finder_spec.rb | 10 | ||||
-rw-r--r-- | spec/finders/members_finder_spec.rb | 12 | ||||
-rw-r--r-- | spec/finders/merge_requests_finder_spec.rb | 4 | ||||
-rw-r--r-- | spec/finders/move_to_project_finder_spec.rb | 18 | ||||
-rw-r--r-- | spec/finders/notes_finder_spec.rb | 2 | ||||
-rw-r--r-- | spec/finders/projects_finder_spec.rb | 4 |
14 files changed, 52 insertions, 52 deletions
diff --git a/spec/finders/access_requests_finder_spec.rb b/spec/finders/access_requests_finder_spec.rb index 650f7229647..605777462bb 100644 --- a/spec/finders/access_requests_finder_spec.rb +++ b/spec/finders/access_requests_finder_spec.rb @@ -51,7 +51,7 @@ describe AccessRequestsFinder do context 'when current user can see access requests' do before do - project.add_master(user) + project.add_maintainer(user) group.add_owner(user) end @@ -78,7 +78,7 @@ describe AccessRequestsFinder do context 'when current user can see access requests' do before do - project.add_master(user) + project.add_maintainer(user) group.add_owner(user) end diff --git a/spec/finders/admin/projects_finder_spec.rb b/spec/finders/admin/projects_finder_spec.rb index 7901d5fee28..44cc8debd04 100644 --- a/spec/finders/admin/projects_finder_spec.rb +++ b/spec/finders/admin/projects_finder_spec.rb @@ -54,7 +54,7 @@ describe Admin::ProjectsFinder do context 'filter by visibility_level' do before do - private_project.add_master(user) + private_project.add_maintainer(user) end context 'private' do diff --git a/spec/finders/concerns/finder_with_cross_project_access_spec.rb b/spec/finders/concerns/finder_with_cross_project_access_spec.rb index c784fb87972..1ff65a8101b 100644 --- a/spec/finders/concerns/finder_with_cross_project_access_spec.rb +++ b/spec/finders/concerns/finder_with_cross_project_access_spec.rb @@ -25,7 +25,7 @@ describe FinderWithCrossProjectAccess do let!(:result) { create(:issue) } before do - result.project.add_master(user) + result.project.add_maintainer(user) end def expect_access_check_on_result diff --git a/spec/finders/contributed_projects_finder_spec.rb b/spec/finders/contributed_projects_finder_spec.rb index 60ea98e61c7..9155a8d6fe9 100644 --- a/spec/finders/contributed_projects_finder_spec.rb +++ b/spec/finders/contributed_projects_finder_spec.rb @@ -10,9 +10,9 @@ describe ContributedProjectsFinder do let!(:private_project) { create(:project, :private) } before do - private_project.add_master(source_user) + private_project.add_maintainer(source_user) private_project.add_developer(current_user) - public_project.add_master(source_user) + public_project.add_maintainer(source_user) create(:push_event, project: public_project, author: source_user) create(:push_event, project: private_project, author: source_user) diff --git a/spec/finders/environments_finder_spec.rb b/spec/finders/environments_finder_spec.rb index 3a8a1e7de74..3cd421f22eb 100644 --- a/spec/finders/environments_finder_spec.rb +++ b/spec/finders/environments_finder_spec.rb @@ -7,7 +7,7 @@ describe EnvironmentsFinder do let(:environment) { create(:environment, project: project) } before do - project.add_master(user) + project.add_maintainer(user) end context 'tagged deployment' do diff --git a/spec/finders/group_members_finder_spec.rb b/spec/finders/group_members_finder_spec.rb index 63e15b365a4..f545da3aee4 100644 --- a/spec/finders/group_members_finder_spec.rb +++ b/spec/finders/group_members_finder_spec.rb @@ -9,9 +9,9 @@ describe GroupMembersFinder, '#execute' do let(:user4) { create(:user) } it 'returns members for top-level group' do - member1 = group.add_master(user1) - member2 = group.add_master(user2) - member3 = group.add_master(user3) + member1 = group.add_maintainer(user1) + member2 = group.add_maintainer(user2) + member3 = group.add_maintainer(user3) result = described_class.new(group).execute @@ -19,11 +19,11 @@ describe GroupMembersFinder, '#execute' do end it 'returns members for nested group', :nested_groups do - group.add_master(user2) + group.add_maintainer(user2) nested_group.request_access(user4) - member1 = group.add_master(user1) - member3 = nested_group.add_master(user2) - member4 = nested_group.add_master(user3) + member1 = group.add_maintainer(user1) + member3 = nested_group.add_maintainer(user2) + member4 = nested_group.add_maintainer(user3) result = described_class.new(nested_group).execute @@ -31,11 +31,11 @@ describe GroupMembersFinder, '#execute' do end it 'returns members for descendant groups if requested', :nested_groups do - member1 = group.add_master(user2) - member2 = group.add_master(user1) - nested_group.add_master(user2) - member3 = nested_group.add_master(user3) - member4 = nested_group.add_master(user4) + member1 = group.add_maintainer(user2) + member2 = group.add_maintainer(user1) + nested_group.add_maintainer(user2) + member3 = nested_group.add_maintainer(user3) + member4 = nested_group.add_maintainer(user4) result = described_class.new(group).execute(include_descendants: true) diff --git a/spec/finders/group_projects_finder_spec.rb b/spec/finders/group_projects_finder_spec.rb index 0a69c03e491..d6d95906f5e 100644 --- a/spec/finders/group_projects_finder_spec.rb +++ b/spec/finders/group_projects_finder_spec.rb @@ -17,16 +17,16 @@ describe GroupProjectsFinder do let!(:subgroup_private_project) { create(:project, :private, path: '7', group: subgroup) } before do - shared_project_1.project_group_links.create(group_access: Gitlab::Access::MASTER, group: group) - shared_project_2.project_group_links.create(group_access: Gitlab::Access::MASTER, group: group) - shared_project_3.project_group_links.create(group_access: Gitlab::Access::MASTER, group: group) + shared_project_1.project_group_links.create(group_access: Gitlab::Access::MAINTAINER, group: group) + shared_project_2.project_group_links.create(group_access: Gitlab::Access::MAINTAINER, group: group) + shared_project_3.project_group_links.create(group_access: Gitlab::Access::MAINTAINER, group: group) end subject { finder.execute } describe 'with a group member current user' do before do - group.add_master(current_user) + group.add_maintainer(current_user) end context "only shared" do @@ -68,7 +68,7 @@ describe GroupProjectsFinder do describe 'without group member current_user' do before do - shared_project_2.add_master(current_user) + shared_project_2.add_maintainer(current_user) current_user.reload end @@ -93,8 +93,8 @@ describe GroupProjectsFinder do context "without external user" do before do - private_project.add_master(current_user) - subgroup_private_project.add_master(current_user) + private_project.add_maintainer(current_user) + subgroup_private_project.add_maintainer(current_user) end context 'with subgroups projects', :nested_groups do diff --git a/spec/finders/issues_finder_spec.rb b/spec/finders/issues_finder_spec.rb index 74e91b02f0f..07a2fa86dd7 100644 --- a/spec/finders/issues_finder_spec.rb +++ b/spec/finders/issues_finder_spec.rb @@ -26,7 +26,7 @@ describe IssuesFinder do let(:issues) { described_class.new(search_user, params.reverse_merge(scope: scope, state: 'opened')).execute } before(:context) do - project1.add_master(user) + project1.add_maintainer(user) project2.add_developer(user) project2.add_developer(user2) project3.add_developer(user) diff --git a/spec/finders/joined_groups_finder_spec.rb b/spec/finders/joined_groups_finder_spec.rb index 7f77a713b12..ae3e55f90f1 100644 --- a/spec/finders/joined_groups_finder_spec.rb +++ b/spec/finders/joined_groups_finder_spec.rb @@ -15,7 +15,7 @@ describe JoinedGroupsFinder do context 'without a user' do before do - public_group.add_master(profile_owner) + public_group.add_maintainer(profile_owner) end it 'only shows public groups from profile owner' do @@ -25,9 +25,9 @@ describe JoinedGroupsFinder do context "with a user" do before do - private_group.add_master(profile_owner) - internal_group.add_master(profile_owner) - public_group.add_master(profile_owner) + private_group.add_maintainer(profile_owner) + internal_group.add_maintainer(profile_owner) + public_group.add_maintainer(profile_owner) end context "when the profile visitor is in the private group" do @@ -64,7 +64,7 @@ describe JoinedGroupsFinder do context "if authorized" do before do - internal_group.add_master(profile_visitor) + internal_group.add_maintainer(profile_visitor) end it "shows internal groups if authorized" do diff --git a/spec/finders/members_finder_spec.rb b/spec/finders/members_finder_spec.rb index 2fc5299b0f4..db48f00cd74 100644 --- a/spec/finders/members_finder_spec.rb +++ b/spec/finders/members_finder_spec.rb @@ -11,9 +11,9 @@ describe MembersFinder, '#execute' do it 'returns members for project and parent groups', :nested_groups do nested_group.request_access(user1) - member1 = group.add_master(user2) - member2 = nested_group.add_master(user3) - member3 = project.add_master(user4) + member1 = group.add_maintainer(user2) + member2 = nested_group.add_maintainer(user3) + member3 = project.add_maintainer(user4) result = described_class.new(project, user2).execute @@ -23,9 +23,9 @@ describe MembersFinder, '#execute' do it 'includes nested group members if asked', :nested_groups do project = create(:project, namespace: group) nested_group.request_access(user1) - member1 = group.add_master(user2) - member2 = nested_group.add_master(user3) - member3 = project.add_master(user4) + member1 = group.add_maintainer(user2) + member2 = nested_group.add_maintainer(user3) + member3 = project.add_maintainer(user4) result = described_class.new(project, user2).execute(include_descendants: true) diff --git a/spec/finders/merge_requests_finder_spec.rb b/spec/finders/merge_requests_finder_spec.rb index 669ec602f11..35d0eeda8f6 100644 --- a/spec/finders/merge_requests_finder_spec.rb +++ b/spec/finders/merge_requests_finder_spec.rb @@ -24,7 +24,7 @@ describe MergeRequestsFinder do let!(:merge_request5) { create(:merge_request, :simple, author: user, source_project: project4, target_project: project4) } before do - project1.add_master(user) + project1.add_maintainer(user) project2.add_developer(user) project3.add_developer(user) project2.add_developer(user2) @@ -142,7 +142,7 @@ describe MergeRequestsFinder do end before do - new_project.add_master(user) + new_project.add_maintainer(user) end it 'filters by created_after' do diff --git a/spec/finders/move_to_project_finder_spec.rb b/spec/finders/move_to_project_finder_spec.rb index e1faf3d569c..1511cb0e04c 100644 --- a/spec/finders/move_to_project_finder_spec.rb +++ b/spec/finders/move_to_project_finder_spec.rb @@ -8,7 +8,7 @@ describe MoveToProjectFinder do let(:guest_project) { create(:project) } let(:reporter_project) { create(:project) } let(:developer_project) { create(:project) } - let(:master_project) { create(:project) } + let(:maintainer_project) { create(:project) } subject { described_class.new(user) } @@ -23,9 +23,9 @@ describe MoveToProjectFinder do it 'returns projects equal or above Gitlab::Access::REPORTER ordered by id in descending order' do reporter_project.add_reporter(user) developer_project.add_developer(user) - master_project.add_master(user) + maintainer_project.add_maintainer(user) - expect(subject.execute(project).to_a).to eq([master_project, developer_project, reporter_project]) + expect(subject.execute(project).to_a).to eq([maintainer_project, developer_project, reporter_project]) end it 'does not include the source project' do @@ -57,9 +57,9 @@ describe MoveToProjectFinder do reporter_project.add_reporter(user) developer_project.add_developer(user) - master_project.add_master(user) + maintainer_project.add_maintainer(user) - expect(subject.execute(project).to_a).to eq([master_project, developer_project]) + expect(subject.execute(project).to_a).to eq([maintainer_project, developer_project]) end it 'returns projects after the given offset id' do @@ -67,9 +67,9 @@ describe MoveToProjectFinder do reporter_project.add_reporter(user) developer_project.add_developer(user) - master_project.add_master(user) + maintainer_project.add_maintainer(user) - expect(subject.execute(project, search: nil, offset_id: master_project.id).to_a).to eq([developer_project, reporter_project]) + expect(subject.execute(project, search: nil, offset_id: maintainer_project.id).to_a).to eq([developer_project, reporter_project]) expect(subject.execute(project, search: nil, offset_id: developer_project.id).to_a).to eq([reporter_project]) expect(subject.execute(project, search: nil, offset_id: reporter_project.id).to_a).to be_empty end @@ -84,10 +84,10 @@ describe MoveToProjectFinder do it 'returns projects matching a search query' do foo_project = create(:project) - foo_project.add_master(user) + foo_project.add_maintainer(user) wadus_project = create(:project, name: 'wadus') - wadus_project.add_master(user) + wadus_project.add_maintainer(user) expect(subject.execute(project).to_a).to eq([wadus_project, foo_project]) expect(subject.execute(project, search: 'wadus').to_a).to eq([wadus_project]) diff --git a/spec/finders/notes_finder_spec.rb b/spec/finders/notes_finder_spec.rb index 232f35c86f9..b776e9d856a 100644 --- a/spec/finders/notes_finder_spec.rb +++ b/spec/finders/notes_finder_spec.rb @@ -5,7 +5,7 @@ describe NotesFinder do let(:project) { create(:project) } before do - project.add_master(user) + project.add_maintainer(user) end describe '#execute' do diff --git a/spec/finders/projects_finder_spec.rb b/spec/finders/projects_finder_spec.rb index 0dfe6ba9c32..7931ad9b9f0 100644 --- a/spec/finders/projects_finder_spec.rb +++ b/spec/finders/projects_finder_spec.rb @@ -41,7 +41,7 @@ describe ProjectsFinder do describe 'with private projects' do before do - private_project.add_master(user) + private_project.add_maintainer(user) end it { is_expected.to match_array([public_project, internal_project, private_project]) } @@ -56,7 +56,7 @@ describe ProjectsFinder do describe 'filter by visibility_level' do before do - private_project.add_master(user) + private_project.add_maintainer(user) end context 'private' do |