Skip to content

Instantly share code, notes, and snippets.

@ebouchut
Created September 15, 2014 14:08
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 ebouchut/e3adc84c35b13a98e964 to your computer and use it in GitHub Desktop.
Save ebouchut/e3adc84c35b13a98e964 to your computer and use it in GitHub Desktop.
Stub a method of a Rails Controller in a test
describe MyController do
before do
# ...
# Stub MyController.action to always return OK
def @controller.action
render status: 200, nothing: true
end
end
#...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment