Using fixtures from IRB


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

On Friday, June 23, 2006, at 1:52 PM, Joel R. wrote:

Thanks, Joel
[email protected]

did you try this?

script/console ENV=test


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.
168:in `read’:Errno::ENOENT: No such file or directory - script/…/

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.

NoMethodError: undefined method `users’ for #Object:0x35968
from (irb):1

fixtures :users
NoMethodError: undefined method `fixtures’ for #Object:0x35968
from (irb):2

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs