Skip to content

Commit 91326b4

Browse files
committed
add missing DatabaseCleaner configuration for RSpec
1 parent 3952918 commit 91326b4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

spec/spec_helper.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,14 @@
3838
# the seed, which is printed after each run.
3939
# --seed 1234
4040
config.order = "random"
41+
42+
config.before(:suite) do
43+
DatabaseCleaner.strategy = :truncation
44+
end
45+
config.before(:each) do
46+
DatabaseCleaner.start
47+
end
48+
config.after(:each) do
49+
DatabaseCleaner.clean
50+
end
4151
end

0 commit comments

Comments
 (0)