Hi, I'm trying to do unit tests which should save informations into a database that another computer should be able to get while the test is running. The problem is although my unit test class has "use_transactional_fixtures" set to false, when I create a new instance of a model and save it, it does not actually appear in the database when connecting to this same database with the "mysql" command line tool. The fixtures are the only present records. My question is: how to do so that the records actually get inserted into the test database ? Thank you :-).
on 2006-06-12 00:38
on 2006-06-12 00:44
(Sorry for the careless mistake in the title)
on 2006-06-12 20:45
> My question is: how to do so that the records actually get inserted > into the test database ? Unfortunately, this Rails behaviour prevents me from going further in my project. Does anybody have an idea ?
on 2006-06-12 21:01
On Monday, June 12, 2006, at 6:42 PM, Roman LE NEGRATE wrote: >> My question is: how to do so that the records actually get >>inserted > into the test database ? > >Unfortunately, this Rails behaviour prevents me from going further >in my project. >Does anybody have an idea ? >_______________________________________________ >Rails mailing list >firstname.lastname@example.org >http://lists.rubyonrails.org/mailman/listinfo/rails This is normal testing behavior. For each test the database is populated with your fixtures and then torn down again at the end. This prevents tests from being dependent on each other. To get around this behavior you will need to do some hackery in the Testing code. You may want to define a new 'environment' called 'distributed-test' and then patch the testing code to skip the database rollback in that case. Just remember that your tests may behave oddly since they are no longer independent of each other unless you manually reload the data. _Kevin
on 2006-06-13 11:52
> since they are no longer independent of each other unless you manually > reload the data. Thank you Kevin.