0

Given this,

class SomeController < AbstractDocumentsController
  def create
    foo_method(params)
    bar_method
  end
end

How can I test foo_method and bar_method is called when create action is invoked?

1 Answer 1

1

I think you should use mocks for this. Example with rspec-mocks Github docs

For you code sample you can use something like this, I think expect_any_instance_of(SomeController).to receive(:foo_method)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.