mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Fix missing roles error in spec workflow #create_enterprise_user
This commit is contained in:
@@ -26,8 +26,8 @@ module AuthenticationWorkflow
|
||||
|
||||
# TODO: Should probably just rename this to create_user
|
||||
def create_enterprise_user( attrs = {} )
|
||||
new_user = create(:user, attrs)
|
||||
new_user.spree_roles = [] # for some reason unbeknown to me, this new user gets admin permissions by default.
|
||||
new_user = build(:user, attrs)
|
||||
new_user.spree_roles = [Spree::Role.find_or_create_by!(name: 'user')]
|
||||
new_user.save
|
||||
new_user
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user