Skip to content

Instantly share code, notes, and snippets.

@jgraichen
Last active December 20, 2015 19:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jgraichen/6186630 to your computer and use it in GitHub Desktop.
Save jgraichen/6186630 to your computer and use it in GitHub Desktop.
let!(:operation) { Acfs::Stub.resource :update, MyResource, with: { id: 1, key: "value" }, return: { id: 1, key: "value" } }
it "should call update action" do
# call you complex method here
# eg. call controller method with form params
post :update, id: 1, my_resource: { key: "value" }, format: "json"
expect(operation).to be_called
end
# You can also test for a specific call count
expect(operation).to be_called 5.times
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment