made changes to how roles are set on registering new users

This commit is contained in:
Adam Piontek 2021-02-27 08:17:30 -05:00
parent 2358b6adfb
commit 42b2ea9d78
5 changed files with 135 additions and 62 deletions
priv/repo

View file

@ -9,26 +9,30 @@
#
# We recommend using the bang functions (`insert!`, `update!`
# and so on) as they will fail if something goes wrong.
alias Bones73k.Accounts
{:ok, admin} =
Bones73k.Accounts.register_admin(%{
Accounts.register_user(%{
email: "admin@company.com",
password: "123456789abc",
password_confirmation: "123456789abc"
password_confirmation: "123456789abc",
role: Accounts.registration_role()
})
{:ok, user_1} =
Bones73k.Accounts.register_user(%{
Accounts.register_user(%{
email: "user1@company.com",
password: "123456789abc",
password_confirmation: "123456789abc"
password_confirmation: "123456789abc",
role: Accounts.registration_role()
})
{:ok, user_2} =
Bones73k.Accounts.register_user(%{
Accounts.register_user(%{
email: "user2@company.com",
password: "123456789abc",
password_confirmation: "123456789abc"
password_confirmation: "123456789abc",
role: Accounts.registration_role()
})
Enum.each(1..10, fn i ->