I'm newbie in Ruby and Rails. I just started to work with both.
The application I'm working on uses rspec
to run the tests in Ruby on Rails and at each round all the database tables are truncated. Tailing log/test.log
displays many lines with TRUNCATE TABLE <table>
. I see many posts that uses Database cleaner
gem with configurations like:
config.before(:each) do
DatabaseCleaner.strategy = :transaction
end
that would skip TRUNCATE tables. Or more comprehensive configurations like:
config.before(:suite) do
DatabaseCleaner.clean_with :transaction
end
config.before(:each) do
DatabaseCleaner.strategy = :transaction
end
config.before(:all) do
DatabaseCleaner.start
end
config.after(:all) do
DatabaseCleaner.clean
end
but it doesn't work.
There are other posts that suggests to set fsync=off
in Postgres configuration, other tutorial suggests to set full_page_writes=off
too. But I didn't fiund anything about MySQL, the DBMS I'm using.
Is there a similar configuration for MySQL?