system_init.rb 458 B

123456789101112131415
  1. RSpec.configure do |config|
  2. config.before(:suite) do
  3. email = 'admin@example.com'
  4. if !::User.exists?(email: email)
  5. FactoryBot.create(:user,
  6. login: 'admin',
  7. firstname: 'Admin',
  8. lastname: 'Admin',
  9. email: email,
  10. password: 'admin',
  11. roles: [Role.lookup(name: 'Admin')],)
  12. end
  13. end
  14. end