diff --git a/test/skate_web/controllers/detours_controller_test.exs b/test/skate_web/controllers/detours_controller_test.exs index 8437dcab2..40ba9dc52 100644 --- a/test/skate_web/controllers/detours_controller_test.exs +++ b/test/skate_web/controllers/detours_controller_test.exs @@ -197,7 +197,10 @@ defmodule SkateWeb.DetoursControllerTest do describe "detour/2" do @tag :authenticated - test "fetches single detour with its state from database", %{conn: conn} do + test "fetches single detour with its state from database", %{ + conn: conn, + user: %{email: email} + } do populate_db_and_get_user(conn) conn = get(conn, "/api/detours/1") @@ -206,7 +209,7 @@ defmodule SkateWeb.DetoursControllerTest do assert %{ "data" => %{ - "author" => "test_user@test.com", + "author" => ^email, "state" => %{ "context" => %{ "nearestIntersection" => "Street A & Avenue B", diff --git a/test/skate_web/controllers/page_controller_test.exs b/test/skate_web/controllers/page_controller_test.exs index 7b42b46ba..d281b3cc8 100644 --- a/test/skate_web/controllers/page_controller_test.exs +++ b/test/skate_web/controllers/page_controller_test.exs @@ -222,17 +222,17 @@ defmodule SkateWeb.PageControllerTest do end @tag :authenticated - test "correct username set", %{conn: conn} do + test "correct username set", %{conn: conn, user: %{username: username}} do conn = get(conn, "/") - assert html_response(conn, 200) =~ "" + assert html_response(conn, 200) =~ "" end @tag :authenticated - test "correct email address set", %{conn: conn} do + test "correct email address set", %{conn: conn, user: %{email: email}} do conn = get(conn, "/") assert html_response(conn, 200) =~ - "data-email-address=\"test_user@test.com\"" + "data-email-address=\"#{email}\"" end @tag :authenticated