diff --git a/test/test_helper.rb b/test/test_helper.rb index b23110e..71e7c8f 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -37,9 +37,11 @@ # ---------------------------------------------------------------------- def org_admin_from(org) usr = org.users.select{|u| u.can_org_admin?}.first - usr = User.create!(email: "admin@example.com", password: "password123", password_confirmation: "password123", - perms: Perm.where.not(name: ['admin', 'add_organisations', 'change_org_affiliation', 'grant_api_to_orgs']), - org: org, accept_terms: true, confirmed_at: Time.zone.now) if usr.nil? + usr = User.create!(email: "admin@example.com", firstname: "Org", surname: "Admin", + language: Language.find_by(abbreviation: I18n.locale), + password: "password123", password_confirmation: "password123", + perms: Perm.where.not(name: ['admin', 'add_organisations', 'change_org_affiliation', 'grant_api_to_orgs']), + org: org, accept_terms: true, confirmed_at: Time.zone.now) if usr.nil? usr end