Last active
October 15, 2016 11:13
-
-
Save notapatch/fb6c0240557c2e1d6f03dca02a3c0b72 to your computer and use it in GitHub Desktop.
Minitest - running tests for rack and javascript.
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
Minitest/Database_cleaner/ Minitest::Around | |
require 'minitest/around' | |
require 'database_cleaner' | |
DatabaseCleaner.strategy = :deletion <===? should it always be deletion? | |
class Capybara::Rails::TestCase | |
around do |test| | |
if metadata[:js] | |
DatabaseCleaner.cleaning(&test) | |
else | |
test.call | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment