@@ -43,7 +43,8 @@ defmodule ApiEcommerceWeb.UserControllerTest do
4343 % {
4444 "id" => current_user . id ,
4545 "email" => current_user . email ,
46- "status" => current_user . status |> Atom . to_string ( )
46+ "status" => current_user . status |> Atom . to_string ( ) ,
47+ "role" => current_user . role |> Atom . to_string ( )
4748 }
4849 ]
4950 end
@@ -60,6 +61,7 @@ defmodule ApiEcommerceWeb.UserControllerTest do
6061 "id" => id ,
6162 "email" => @ create_attrs . email ,
6263 "status" => "active" ,
64+ "role" => "member"
6365 }
6466 end
6567
@@ -81,7 +83,8 @@ defmodule ApiEcommerceWeb.UserControllerTest do
8183 assert json_response ( conn , 200 ) [ "data" ] == % {
8284 "id" => id ,
8385 "email" => @ update_attrs . email ,
84- "status" => user . status |> Atom . to_string ( )
86+ "status" => user . status |> Atom . to_string ( ) ,
87+ "role" => user . role |> Atom . to_string ( )
8588 }
8689 end
8790
@@ -111,8 +114,9 @@ defmodule ApiEcommerceWeb.UserControllerTest do
111114
112115 assert json_response ( conn , 200 ) [ "data" ] == % {
113116 "id" => current_user . id ,
117+ "email" => current_user . email ,
114118 "status" => current_user . status |> Atom . to_string ( ) ,
115- "email " => current_user . email }
119+ "role " => current_user . role |> Atom . to_string ( ) }
116120 end
117121
118122 test "renders errors when user credentials are bad" , % { conn: conn } do
0 commit comments