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?
On Dec 4, 4:33pm, Guo Y. [email protected] wrote:
require ‘test_helper’
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
Frederick C. wrote in post #966198:
On Dec 4, 4:33pm, Guo Y. [email protected] wrote:
require ‘test_helper’
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
hi Fred,you are right,i made a mistake when converting a str to
date.Thank you.