I’ve got a strange issue. My default unit tests are failing for two
models. I
haven’t changed anything in the test. Here’s an example:
Output:
Error:
test_truth(ShippingCostTypeTest):
NoMethodError: You have a nil object when you didn’t expect it!
You might have expected an instance of Array.
The error occured while evaluating nil.find
I’ve got a strange issue. My default unit tests are failing for two
models. I
haven’t changed anything in the test. Here’s an example:
Output:
Error:
test_truth(ShippingCostTypeTest):
NoMethodError: You have a nil object when you didn’t expect it!
You might have expected an instance of Array.
The error occured while evaluating nil.find
Jon, here’s how I got I working on mine. I added a setup method:
def setup @game = Game.find(1)
end
Then changed the default test_truth method to
def test_truth
assert_kind_of Game, @game
end
Of course switch out the variables to, I guess, @shipping_cost_type and
such for your test.
Jon wrote:
I’ve got a strange issue. My default unit tests are failing for two
models. I
haven’t changed anything in the test. Here’s an example:
Output:
Error:
test_truth(ShippingCostTypeTest):
NoMethodError: You have a nil object when you didn’t expect it!
You might have expected an instance of Array.
The error occured while evaluating nil.find