as stated in Rails Book example , I have a fixtures file orders.yml
valid_order_for_fred:
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
test/functional/orders_controller_test.rb:65:in
`test_save_valid_order''
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---