Pre-loaded fixtures wiped-out by test run

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Pre-loaded fixtures wiped-out by test run

Alex Dilley
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 [hidden email].
To post to this group, send email to [hidden email].
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.
Loading...