Created
September 15, 2014 14:08
-
-
Save ebouchut/e3adc84c35b13a98e964 to your computer and use it in GitHub Desktop.
Stub a method of a Rails Controller in a test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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