Created
November 1, 2011 18:27
-
-
Save julik/1331449 to your computer and use it in GitHub Desktop.
Transactional database in Minitest in 7 lines of code
This file contains 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
module TransactionalTests | |
# See minitest doco - use_transactional_fixtures_but_in_ruby | |
# to use include this into your test case | |
def run(runner) | |
test_result = nil | |
ActiveRecord::Base.transaction { test_result = super; raise ActiveRecord::Rollback } | |
test_result | |
end | |
end |
where do you put this and how do you include it?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
saved my day!