2022-12-07 18:12:54 +01:00
|
|
|
require 'sidekiq/testing'
|
|
|
|
|
|
|
|
|
|
ldap = LdapService.new
|
|
|
|
|
|
|
|
|
|
Sidekiq::Testing.inline! do
|
|
|
|
|
CreateAccount.call(
|
|
|
|
|
username: "admin", domain: "kosmos.org", email: "admin@example.com",
|
|
|
|
|
password: "admin is admin", confirmed: true
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
ldap.add_attribute "cn=admin,ou=kosmos.org,cn=users,dc=kosmos,dc=org", :admin, "true"
|
|
|
|
|
|
2023-03-01 17:07:13 +08:00
|
|
|
35.times do |n|
|
2022-12-07 18:12:54 +01:00
|
|
|
username = Faker::Name.unique.first_name.downcase
|
|
|
|
|
email = Faker::Internet.unique.email
|
2023-09-04 11:35:51 +02:00
|
|
|
next if username.length < 3
|
2022-12-07 18:12:54 +01:00
|
|
|
|
|
|
|
|
CreateAccount.call(
|
|
|
|
|
username: username, domain: "kosmos.org", email: email,
|
|
|
|
|
password: "user is user", confirmed: true
|
|
|
|
|
)
|
|
|
|
|
end
|
|
|
|
|
end
|