Ruby on Rails Wednesday, July 26, 2017

If you preload your test database with all fixture data via the rake task:

bin/rails db:fixtures:load

And set self.pre_loaded_fixtures to true:

class ActiveSupport::TestCase
  self.pre_loaded_fixtures = true
  self.use_transactional_tests = true # the default

  fixtures :all
end

Would you expect the fixtures to be deleted and reinserted on every test run (caused by ActiveRecord::FixtureSet.create_fixtures – the same code exercised by the rake task)? Given the documentation on Transactional Tests, I'd imagine this to be unexpected behaviour but, regardless of options configured, fixture data is always reinstalled by the fixtures :all call.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/7fa39237-b9ce-42b1-919b-5c4a203b58a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment