Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Fix sandbox not clearing after each test #316

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions test/teiserver/common/clear_db_each_test.exs
Original file line number Diff line number Diff line change
@@ -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

Check failure on line 7 in test/teiserver/common/clear_db_each_test.exs

View workflow job for this annotation

GitHub Actions / Build and test

test Sandbox test 1 (Teiserver.Common.ClearDbEachTest)
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
Loading