From e5ce4c5d024b30511fefd87490f51a65a383aefc Mon Sep 17 00:00:00 2001 From: Joshua Augustinus Date: Sun, 9 Jun 2024 19:36:32 +1000 Subject: [PATCH] Failing test Update clear_db_each_test.exs --- test/teiserver/common/clear_db_each_test.exs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 test/teiserver/common/clear_db_each_test.exs diff --git a/test/teiserver/common/clear_db_each_test.exs b/test/teiserver/common/clear_db_each_test.exs new file mode 100644 index 000000000..bfdefcf01 --- /dev/null +++ b/test/teiserver/common/clear_db_each_test.exs @@ -0,0 +1,20 @@ +defmodule Teiserver.Common.ClearDbEachTest do + @moduledoc """ + Tests that the sandbox db is cleared after each test + """ + use Teiserver.DataCase, async: true + + test "Sandbox test 1" do + name = "ClearDbEachTestUser" + user = Teiserver.TeiserverTestLib.new_user(name) + result = Teiserver.CacheUser.get_user_by_id(user.id) + assert result[:name] == name + end + + test "Sandbox test 2" do + name = "ClearDbEachTestUser" + user = Teiserver.TeiserverTestLib.new_user(name) + result = Teiserver.CacheUser.get_user_by_id(user.id) + assert result[:name] == name + end +end