I have configured a rails 3 application to use mysql as orm and factory_girl as fixture_replacement in test_unit. I created successful with 'rake db:create:all' the databases 'x_development', 'x_test' and 'x_production'. Then I run 'rails g scaffold event ... -r factory_girl' and get a model 'event.rb', a controller 'events_controller.rb',... a factory definition 'events.rb', a 'test_helper.rb' and a test 'event_controller_test.rb'. Running 'rake db:setup' creates the mysql table 'events' in the 'km_development' db and a browser call to 'localhost:3000/events' is working as expected.
But when I try to run the 'functional' test suite, the I get an error message, that "the table 'events' in the 'x_test' db does not exist". After a google reasearch I tried 'rake db:test:prepare', but this task is unknown in my installation. The only way I found to get this table created was to manually(!!!) set 'export RAILS_ENV=test' in my bash and run then 'rake db:automigrate' which created the table in the test db. Then the test suit started. Is this the recommended approach? Has this behavior to do with the ticket #1428 (db:migrate does not work in rails 3), which has been marked as resolved after the release of 1.0.2? My environment: MAC OSX 10.6.6 MySQL Server 5.5.8 ruby 1.9.2p0 (via rvm) rubygems 1.3.7 rails 3.0.3 railt3-generators 0.17.0 dm-core 1.0.2 dm-rails 1.0.4 do-mysql 0.10.2 factory_girl 1.3.3 factory_girl_rails 1.0.1 mysql 2.8.1 Best regards Kittekat -- You received this message because you are subscribed to the Google Groups "DataMapper" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/datamapper?hl=en.
