Skip to content

Instantly share code, notes, and snippets.

@IanWhitney
Created February 13, 2013 19:07
Show Gist options
  • Select an option

  • Save IanWhitney/4947193 to your computer and use it in GitHub Desktop.

Select an option

Save IanWhitney/4947193 to your computer and use it in GitHub Desktop.
Stubbing a controller method. I had to do this to test an API controller that required authorization.
def setup
@controller.stubs(:token_valid?).returns(true)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment