When I test my Rails controller, I find that records created in
before(:all) remain in database while records created in before(:each)
and let are wiped out after testing. This made me run “rake
test:prepare” for every new test. Is that normal?
When I test my Rails controller, I find that records created in before(:all)
remain in database while records created in before(:each) and let are wiped out
after testing. This made me run “rake test:prepare” for every new test. Is that
normal?
Yes. before(:all) is not run in a transaction.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.