Skip to content

Instantly share code, notes, and snippets.

@notapatch
Last active October 15, 2016 11:13
Show Gist options
  • Save notapatch/fb6c0240557c2e1d6f03dca02a3c0b72 to your computer and use it in GitHub Desktop.
Save notapatch/fb6c0240557c2e1d6f03dca02a3c0b72 to your computer and use it in GitHub Desktop.
Minitest - running tests for rack and javascript.
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