summaryrefslogtreecommitdiff
path: root/spec/models/group_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/group_spec.rb')
-rw-r--r--spec/models/group_spec.rb48
1 files changed, 24 insertions, 24 deletions
diff --git a/spec/models/group_spec.rb b/spec/models/group_spec.rb
index aeec485358e..0729eb99e78 100644
--- a/spec/models/group_spec.rb
+++ b/spec/models/group_spec.rb
@@ -177,7 +177,7 @@ describe Group do
describe 'when the user has access to a group' do
before do
- group.add_user(user, Gitlab::Access::MASTER)
+ group.add_user(user, Gitlab::Access::MAINTAINER)
end
it { is_expected.to eq([group]) }
@@ -229,10 +229,10 @@ describe Group do
let(:user) { create(:user) }
before do
- group.add_user(user, GroupMember::MASTER)
+ group.add_user(user, GroupMember::MAINTAINER)
end
- it { expect(group.group_members.masters.map(&:user)).to include(user) }
+ it { expect(group.group_members.maintainers.map(&:user)).to include(user) }
end
describe '#add_users' do
@@ -254,7 +254,7 @@ describe Group do
let(:user) { create(:user) }
before do
- group.add_user(user, GroupMember::MASTER)
+ group.add_user(user, GroupMember::MAINTAINER)
end
it "is true if avatar is image" do
@@ -274,7 +274,7 @@ describe Group do
context 'when avatar file is uploaded' do
before do
- group.add_master(user)
+ group.add_maintainer(user)
end
it 'shows correct avatar url' do
@@ -317,7 +317,7 @@ describe Group do
end
it { expect(group.has_owner?(@members[:owner])).to be_truthy }
- it { expect(group.has_owner?(@members[:master])).to be_falsey }
+ it { expect(group.has_owner?(@members[:maintainer])).to be_falsey }
it { expect(group.has_owner?(@members[:developer])).to be_falsey }
it { expect(group.has_owner?(@members[:reporter])).to be_falsey }
it { expect(group.has_owner?(@members[:guest])).to be_falsey }
@@ -325,19 +325,19 @@ describe Group do
it { expect(group.has_owner?(nil)).to be_falsey }
end
- describe '#has_master?' do
+ describe '#has_maintainer?' do
before do
@members = setup_group_members(group)
- create(:group_member, :invited, :master, group: group)
+ create(:group_member, :invited, :maintainer, group: group)
end
- it { expect(group.has_master?(@members[:owner])).to be_falsey }
- it { expect(group.has_master?(@members[:master])).to be_truthy }
- it { expect(group.has_master?(@members[:developer])).to be_falsey }
- it { expect(group.has_master?(@members[:reporter])).to be_falsey }
- it { expect(group.has_master?(@members[:guest])).to be_falsey }
- it { expect(group.has_master?(@members[:requester])).to be_falsey }
- it { expect(group.has_master?(nil)).to be_falsey }
+ it { expect(group.has_maintainer?(@members[:owner])).to be_falsey }
+ it { expect(group.has_maintainer?(@members[:maintainer])).to be_truthy }
+ it { expect(group.has_maintainer?(@members[:developer])).to be_falsey }
+ it { expect(group.has_maintainer?(@members[:reporter])).to be_falsey }
+ it { expect(group.has_maintainer?(@members[:guest])).to be_falsey }
+ it { expect(group.has_maintainer?(@members[:requester])).to be_falsey }
+ it { expect(group.has_maintainer?(nil)).to be_falsey }
end
describe '#lfs_enabled?' do
@@ -401,7 +401,7 @@ describe Group do
def setup_group_members(group)
members = {
owner: create(:user),
- master: create(:user),
+ maintainer: create(:user),
developer: create(:user),
reporter: create(:user),
guest: create(:user),
@@ -409,7 +409,7 @@ describe Group do
}
group.add_user(members[:owner], GroupMember::OWNER)
- group.add_user(members[:master], GroupMember::MASTER)
+ group.add_user(members[:maintainer], GroupMember::MAINTAINER)
group.add_user(members[:developer], GroupMember::DEVELOPER)
group.add_user(members[:reporter], GroupMember::REPORTER)
group.add_user(members[:guest], GroupMember::GUEST)
@@ -439,25 +439,25 @@ describe Group do
describe '#members_with_parents', :nested_groups do
let!(:group) { create(:group, :nested) }
- let!(:master) { group.parent.add_user(create(:user), GroupMember::MASTER) }
+ let!(:maintainer) { group.parent.add_user(create(:user), GroupMember::MAINTAINER) }
let!(:developer) { group.add_user(create(:user), GroupMember::DEVELOPER) }
it 'returns parents members' do
expect(group.members_with_parents).to include(developer)
- expect(group.members_with_parents).to include(master)
+ expect(group.members_with_parents).to include(maintainer)
end
end
describe '#direct_and_indirect_members', :nested_groups do
let!(:group) { create(:group, :nested) }
let!(:sub_group) { create(:group, parent: group) }
- let!(:master) { group.parent.add_user(create(:user), GroupMember::MASTER) }
+ let!(:maintainer) { group.parent.add_user(create(:user), GroupMember::MAINTAINER) }
let!(:developer) { group.add_user(create(:user), GroupMember::DEVELOPER) }
let!(:other_developer) { group.add_user(create(:user), GroupMember::DEVELOPER) }
it 'returns parents members' do
expect(group.direct_and_indirect_members).to include(developer)
- expect(group.direct_and_indirect_members).to include(master)
+ expect(group.direct_and_indirect_members).to include(maintainer)
end
it 'returns descendant members' do
@@ -539,14 +539,14 @@ describe Group do
describe '#user_ids_for_project_authorizations' do
it 'returns the user IDs for which to refresh authorizations' do
- master = create(:user)
+ maintainer = create(:user)
developer = create(:user)
- group.add_user(master, GroupMember::MASTER)
+ group.add_user(maintainer, GroupMember::MAINTAINER)
group.add_user(developer, GroupMember::DEVELOPER)
expect(group.user_ids_for_project_authorizations)
- .to include(master.id, developer.id)
+ .to include(maintainer.id, developer.id)
end
end