Hi all,
I’m having error on all unit test. Even this one:
hash = { :title => “recipe title”,
:description => “recipe description”,
:serving => 1,
:directions => “do it”
}
recipe_expected = Recipe.new(hash)
recipe_should_be_equal = Recipe.new(hash)
assert_equal(recipe_expected, recipe_should_be_equal)
And this is the error i get:
test_should_be_equal
FAIL
./test/unit/recipe_test.rb:16:in `test_should_be_equal’
<#<Recipe id: nil, title: “recipe title”, serving: 1,
description:
“recipe description”, directions: “do it”, created_at: nil, updated_at:
nil>> expected but was
<#<Recipe id: nil, title: “recipe title”, serving: 1,
description:
“recipe description”, directions: “do it”, created_at: nil, updated_at:
nil>>.
As far as i can see, the object is the same. I’m wondering why this is
happening.
Thanks,
Dida