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