hi, I am doing unit testing. I have a table as SalesOrder, where "ordernumber" is the primary key of the table. When I insert records in the table from unit testing, I got error like,
ActiveRecord::RecordNotFound: Couldn't find SalesOrder without an ID But, I have fixed the error by adding set_primary_key "ordernumber" in the model, and tested the unit test class and works well. But, If I insert record from the application as SalesOrder.save, I got the same error. If I comment the line set_primary_key in the model, then the application works fine, but unit testing fails with this error. Is there any alternative way, where unit test and application accepts? Thank you -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---