Created
October 10, 2012 14:01
-
-
Save notapatch/3865824 to your computer and use it in GitHub Desktop.
Controller Testing Syntax: With reference to creating a params hash
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
# 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