Folks, I have the standard setup with auto-generated unit tests and fixtures. I edited the fixtures and the tests but would now like to test associations from irb. How do I do this? I''m not sure how to load my fixtures into irb, for example. Once they are loaded I would create objects, save them to the db and pull things out. Thanks, Joel -- http://wagerlabs.com/
On Friday, June 23, 2006, at 1:52 PM, Joel Reymont wrote:>Folks, > >I have the standard setup with auto-generated unit tests and >fixtures. I edited the fixtures and the tests but would now like to >test associations from irb. How do I do this? > >I''m not sure how to load my fixtures into irb, for example. Once >they are loaded I would create objects, save them to the db and pull >things out. > > Thanks, Joel > >-- >http://wagerlabs.com/ > > > > > >_______________________________________________ >Rails mailing list >Rails@lists.rubyonrails.org >http://lists.rubyonrails.org/mailman/listinfo/railsdid you try this? script/console ENV=test _Kevin -- Posted with http://DevLists.com. Sign up and save your mailbox.
On Jun 23, 2006, at 3:25 PM, Kevin Olbrich wrote:> did you try this? > > script/console ENV=testscript/console ENV=test Loading ENV=test environment. /opt/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/initializer.rb: 168:in `read'':Errno::ENOENT: No such file or directory - script/../ config/../config/../config/environments/ENV=test.rb I have been doing ''RAILS_ENV=test script/console'' but ''script/console test'' appears to work just as well. What I can''t figure out is the following. I have a test_user fixture and a User model. script/console test Loading test environment. >> users(:test_user) NoMethodError: undefined method `users'' for #<Object:0x35968> from (irb):1 >> fixtures :users NoMethodError: undefined method `fixtures'' for #<Object:0x35968> from (irb):2 -- http://wagerlabs.com/