Using fixtures from IRB

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 R. wrote:

Thanks, Joel
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

did you try this?

script/console ENV=test

_Kevin

On Jun 23, 2006, at 3:25 PM, Kevin O. wrote:

did you try this?

script/console ENV=test

script/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/