akkounts/db/seeds.rb
Râu Cao 56d91083e5
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
Release Drafter / Update release notes draft (pull_request) Successful in 3s
Fix seeds for new keyword argument
2024-02-22 13:24:41 +01:00

24 lines
634 B
Ruby

require 'sidekiq/testing'
ldap = LdapService.new
Sidekiq::Testing.inline! do
CreateAccount.call(account: {
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"
35.times do |n|
username = Faker::Name.unique.first_name.downcase
email = Faker::Internet.unique.email
next if username.length < 3
CreateAccount.call(account: {
username: username, domain: "kosmos.org", email: email,
password: "user is user", confirmed: true
})
end
end