describe Foo do
describe 'create' do
let( :expected_foo ){ Foo.new( name:'foo 1', value:'bar' )}
it 'succeeds' do
Foo.create( name:'foo 1', value:'bar' )
Foo.first.should == expected_foo
end
end
end
This test will fail because expected_foo is a different object from the object in the database.
It seems the best way to handle this equality is with a custom matcher. Is it possible to use a custom matcher to overload == ?