From 2ec60ba3426401f528c70b5ab9d258a8dbe9648c Mon Sep 17 00:00:00 2001 From: shibao Date: Wed, 23 Nov 2022 21:14:29 -0500 Subject: [PATCH] fix admin user fixture --- test/support/fixtures.ex | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/support/fixtures.ex b/test/support/fixtures.ex index 80ddfa9f..63254c85 100644 --- a/test/support/fixtures.ex +++ b/test/support/fixtures.ex @@ -13,6 +13,7 @@ defmodule Cannery.Fixtures do Containers, Containers.Container, Email, + Repo, Tags, Tags.Tag } @@ -38,11 +39,12 @@ defmodule Cannery.Fixtures do attrs |> Enum.into(%{ "email" => unique_user_email(), - "password" => valid_user_password(), - "role" => "admin" + "password" => valid_user_password() }) |> Accounts.register_user() |> unwrap_ok_tuple() + |> User.role_changeset("admin") + |> Repo.update!() end def extract_user_token(fun) do