diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2019-02-19 15:59:10 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2019-02-19 15:59:10 +0300 |
commit | e681c3802fef8f844f0ae073498b1ceff551ff8f (patch) | |
tree | 9b57621c60ad6b889f5625161aa1ae104318295f /spec | |
parent | 61b606a803cf9c197eee3f1397562f94dd3df315 (diff) | |
parent | 9dca756976be018c54d12b3d0510326b9d98f7de (diff) |
Merge branch 'ce-move-ee-specific-factories-to-ee-spec' into 'master'
Refactor spec/factories/users.rb to allow EE to extend it
See merge request gitlab-org/gitlab-ce!25258
Diffstat (limited to 'spec')
-rw-r--r-- | spec/factories/import_states.rb (renamed from spec/factories/import_state.rb) | 0 | ||||
-rw-r--r-- | spec/factories/users.rb | 11 |
2 files changed, 8 insertions, 3 deletions
diff --git a/spec/factories/import_state.rb b/spec/factories/import_states.rb index d6de26dccbc..d6de26dccbc 100644 --- a/spec/factories/import_state.rb +++ b/spec/factories/import_states.rb diff --git a/spec/factories/users.rb b/spec/factories/users.rb index a47bd7cafca..1d2b724a5e5 100644 --- a/spec/factories/users.rb +++ b/spec/factories/users.rb @@ -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 |