Last active
August 29, 2015 14:16
-
-
Save sorentwo/9c9c7aab4b9ae8795aa7 to your computer and use it in GitHub Desktop.
Transactional Tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule CustomTest.Case do | |
use ExUnit.CaseTemplate | |
alias Ecto.Adapters.SQL | |
setup_all do | |
SQL.begin_test_transaction(Repo) | |
on_exit fn -> | |
SQL.rollback_test_transaction(Repo) | |
end | |
end | |
setup do | |
SQL.restart_test_transaction(Repo) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment