Forum: Ruby on Rails instance variable attributes() method in tests fixtures

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Kad K. (Guest)
on 2007-05-22 19:11
as stated in Rails Book example , I have a fixtures file  orders.yml

id: 1
name: Fred
email_address: fred@flinstone;com

in my controller test file,  I tried :
fixtures :orders
def test_save_valid_order
post :save_order, :order => @valid_order_fo_fred.attributes

but I get an error

NoMethodError: You have a nil object when you didn't expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.attributes
This topic is locked and can not be replied to.