Refactor spec/factories/users.rb to allow EE to extend it

Signed-off-by: Rémy Coutable <remy@rymai.me>
This commit is contained in:
Rémy Coutable 2019-02-14 18:56:34 +01:00
parent fe10964a68
commit c78adba6d3
No known key found for this signature in database
GPG Key ID: 98DFFD1C0C62B70B
1 changed files with 8 additions and 3 deletions

View File

@ -73,11 +73,16 @@ FactoryBot.define do
end
after(:create) do |user, evaluator|
user.identities << create(
:identity,
identity_attrs = {
provider: evaluator.provider,
extern_uid: evaluator.extern_uid
)
}
if evaluator.respond_to?(:saml_provider)
identity_attrs[:saml_provider] = evaluator.saml_provider
end
user.identities << create(:identity, identity_attrs)
end
end