Skip to content
Browse files

add database_cleaner support

  • Loading branch information...
1 parent 0b4cb9e commit 04be6b1acebca58707502d98023984b639fec541 @phlipper phlipper committed
View
12 lib/generators/thincloud/test/templates/database_cleaner.rb
@@ -0,0 +1,12 @@
+DatabaseCleaner.strategy = :transaction
+DatabaseCleaner.clean_with :truncation
+
+class MiniTest::Spec
+ before :each do
+ DatabaseCleaner.start
+ end
+
+ after :each do
+ DatabaseCleaner.clean
+ end
+end
View
1 lib/generators/thincloud/test/test_generator.rb
@@ -15,6 +15,7 @@ def test
remove_file "test/minitest_helper.rb"
copy_file "minitest_helper.rb", "test/minitest_helper.rb"
+ copy_file "database_cleaner.rb", "test/support/database_cleaner.rb"
copy_file "test.rake", "lib/tasks/test.rake"
copy_file "Guardfile"
View
1 thincloud-test.gemspec
@@ -18,6 +18,7 @@ Gem::Specification.new do |s|
s.add_dependency "rails", "~> 3.2.8"
s.add_dependency "cane", "~> 2.3.0"
+ s.add_dependency "database_cleaner", "~> 0.8.0"
s.add_dependency "guard", "~> 1.4.0"
s.add_dependency "factory_girl_rails", "~> 4.1.0"
s.add_dependency "minitest", "~> 3.5.0"

0 comments on commit 04be6b1

Please sign in to comment.
Something went wrong with that request. Please try again.