Skip to content

Instantly share code, notes, and snippets.

@notapatch
Created October 10, 2012 14:01
Show Gist options
  • Save notapatch/3865824 to your computer and use it in GitHub Desktop.
Save notapatch/3865824 to your computer and use it in GitHub Desktop.
Controller Testing Syntax: With reference to creating a params hash
# def post(action_name, params_hash = {}, session_hash = {})
describe PasswordResetsController do
describe "#create" do
it "does something when I post" do
post :create, user: { email: '[email protected]' }
end
end
end
#Controller to be tested
def create
PasswordReset.new(params[:user])
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment