F
Fernando Perez
Hi,
How to create an assertion that only checks that a given method is
invoked at least once.
In my Rails app I wanted to mock current_user, but I don't care how many
times it gets called, but I want to make sure it is called, so:
@controller.expectscurrent_user).returns(@user)
doesn't work, because for instance it tells it was already invoked once.
Thanks.
How to create an assertion that only checks that a given method is
invoked at least once.
In my Rails app I wanted to mock current_user, but I don't care how many
times it gets called, but I want to make sure it is called, so:
@controller.expectscurrent_user).returns(@user)
doesn't work, because for instance it tells it was already invoked once.
Thanks.