On Dec 4, 4:33 pm, Guo Yangguang <[email protected]> wrote: > hi > i have a non active_record class in models dir which is like following: > > class BuildSurvey > > end > > i want to test this class,so manually defined a test file which is like > following > > require 'test_helper' > require 'build_survey' > class BuildSurveyTest < ActiveSupport::TestCase > > end > > but when i ran test,i got error like this: > > undefined method '<' nil:NilClass > > i want to know how to test a non active_record class in models directory > in rails 3.can you help me?
You don't have to do anything beyond what you've shown (the require build_survey is unnecessary) You're going to have to show a little more (eg what does the backtrace for that error look like?) Fred > > -- > Posted viahttp://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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

