Commit 90112f57 authored by Maxim Rydkin's avatar Maxim Rydkin

replace `is_member_of` with `member_of?`

parent 81061aef
...@@ -244,11 +244,11 @@ Style/PerlBackrefs: ...@@ -244,11 +244,11 @@ Style/PerlBackrefs:
# NameWhitelist: is_a? # NameWhitelist: is_a?
Style/PredicateName: Style/PredicateName:
Enabled: true Enabled: true
Exclude: # Exclude:
- 'features/*' # - 'features/*'
# NamePrefix: is_ # NamePrefix: is_
NamePrefixBlacklist: is_ NamePrefixBlacklist: is_
NameWhitelist: has_n_stars NameWhitelist: have_visible_content
# Offense count: 58 # Offense count: 58
# Cop supports --auto-correct. # Cop supports --auto-correct.
......
...@@ -2,27 +2,27 @@ module SharedGroup ...@@ -2,27 +2,27 @@ module SharedGroup
include Spinach::DSL include Spinach::DSL
step 'current user is developer of group "Owned"' do step 'current user is developer of group "Owned"' do
is_member_of(current_user.name, "Owned", Gitlab::Access::DEVELOPER) member_of?(current_user.name, "Owned", Gitlab::Access::DEVELOPER)
end end
step '"John Doe" is owner of group "Owned"' do step '"John Doe" is owner of group "Owned"' do
is_member_of("John Doe", "Owned", Gitlab::Access::OWNER) member_of?("John Doe", "Owned", Gitlab::Access::OWNER)
end end
step '"John Doe" is guest of group "Guest"' do step '"John Doe" is guest of group "Guest"' do
is_member_of("John Doe", "Guest", Gitlab::Access::GUEST) member_of?("John Doe", "Guest", Gitlab::Access::GUEST)
end end
step '"Mary Jane" is owner of group "Owned"' do step '"Mary Jane" is owner of group "Owned"' do
is_member_of("Mary Jane", "Owned", Gitlab::Access::OWNER) member_of?("Mary Jane", "Owned", Gitlab::Access::OWNER)
end end
step '"Mary Jane" is guest of group "Owned"' do step '"Mary Jane" is guest of group "Owned"' do
is_member_of("Mary Jane", "Owned", Gitlab::Access::GUEST) member_of?("Mary Jane", "Owned", Gitlab::Access::GUEST)
end end
step '"Mary Jane" is guest of group "Guest"' do step '"Mary Jane" is guest of group "Guest"' do
is_member_of("Mary Jane", "Guest", Gitlab::Access::GUEST) member_of?("Mary Jane", "Guest", Gitlab::Access::GUEST)
end end
step 'I should see group "TestGroup"' do step 'I should see group "TestGroup"' do
...@@ -35,7 +35,7 @@ module SharedGroup ...@@ -35,7 +35,7 @@ module SharedGroup
protected protected
def is_member_of(username, groupname, role) def member_of?(username, groupname, role)
@project_count ||= 0 @project_count ||= 0
user = User.find_by(name: username) || create(:user, name: username) user = User.find_by(name: username) || create(:user, name: username)
group = Group.find_by(name: groupname) || create(:group, name: groupname) group = Group.find_by(name: groupname) || create(:group, name: groupname)
......
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