tags:

views:

21

answers:

0

I have a spec which is failing because of this:

unexpected invocation:
#<AnyInstance:Achievement(id: integer, name: string, created_at: datetime, updated_at: datetime)>.errors()

satisfied expectations:
#<AnyInstance:Achievement(id: integer, name: string, created_at: datetime, updated_at: datetime)>.errors(any_parameters)

In my spec I have:

Achievement.any_instance.expects(:errors).returns(errors_mock)

It seems that the empty brackets after the method name are preventing RSpec from correctly matching that call.

Any ideas how to resolve this? I've tried adding with(no_args()) but to no effect.