it is working fine
Thanks in advance?
When you say “foo.should_receive(:bar)” you’re saying "foo should
receive bar sometime between now and the end of this example. The first
example, the “get” is doing something that causes @user.articles to
receive :find_by_id, but in the second example that’s already happened
before you set the expectation and does not happen again, so you get a
failure message.
it is working fine
Thanks in advance?
When you say “foo.should_receive(:bar)” you’re saying "foo should
receive bar sometime between now and the end of this example. The first
example, the “get” is doing something that causes @user.articles to
receive :find_by_id, but in the second example that’s already happened
before you set the expectation and does not happen again, so you get a
failure message.
HTH,
David
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.