After following these instructions I still don't seem to be able to use fixtures from the console.
I'm a beginner trying to learn rails and I think would help my understanding to be able to run the test code in the console.
I've got a fixture file test/fixtures/users.yml that contains:
patrick:
login: patrick
password: sekrit
name: Patrick Lenz
email: patrick@limited-overload.dejohn:
login: john
password: gh752px
name: John Doe
email: john@doe.com
From the console as suggested above I do:
rake db:fixtures:load RAILS_ENV=test
script/console test
but I still don't seem to be able to use the fixture from the console. Here is a paste from my console:
[08:55:31 ~/htdocs/shovell] rake db:fixtures:load RAILS_ENV=test
(in /Applications/mampstack-0.9.4/apache2/htdocs/shovell)
[08:55:48 ~/htdocs/shovell] script/console test
Loading test environment (Rails 2.1.0)
>> users
NameError: undefined local variable or method `users' for #<Object:0x389a0>
from (irb):1
This is running in the tutorial "shovell" application from the "Simply Rails 2" book and the tests that use this fixture do run and pass.
Can anyone tell me how to use a fixture from the console or point me to a good learning resource for working with test code in the console?