spec/support/users.rb in marty-2.5.2 vs spec/support/users.rb in marty-2.5.4
- old
+ new
@@ -1,9 +1,9 @@
module Marty; module RSpec; module Users
def populate_test_users
- (1..2).each { |i|
- Rails.configuration.marty.roles.each { |role_name|
+ (1..2).each do |i|
+ Rails.configuration.marty.roles.each do |role_name|
username = "#{role_name}#{i}"
next if Marty::User.find_by_login(username)
user = Marty::User.new
user.firstname = user.login = username
@@ -17,16 +17,16 @@
user_role = Marty::UserRole.new
user_role.user = user
user_role.role = role
user_role.save!
- }
- }
+ end
+ end
# also create an anon user
user = Marty::User.new
- user.login = user.firstname = user.lastname = "anon"
+ user.login = user.firstname = user.lastname = 'anon'
user.active = true
user.save
end
def system_user
@@ -36,8 +36,7 @@
def create_user(name)
Marty::User.find_or_create_by!(login: name,
firstname: name,
lastname: 'test',
active: true)
-
end
end end end