1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00

Moves sign_up from helpers to controller

This commit is contained in:
Philip Poots 2012-10-23 20:29:41 +01:00
parent 68dc20cba2
commit 692175b897
3 changed files with 6 additions and 12 deletions

View file

@ -87,6 +87,12 @@ class Devise::RegistrationsController < DeviseController
self.resource = resource_class.new_with_session(hash, session)
end
# Signs in a user on sign up. You can overwrite this method in your own
# RegistrationsController.
def sign_up(resource_name, resource)
sign_in(resource_name, resource)
end
# The path used after sign up. You need to overwrite this method
# in your own RegistrationsController.
def after_sign_up_path_for(resource)

View file

@ -93,12 +93,6 @@ module Devise
end
end
# Signs in a user on sign up. This helper delegates to sign_in and separates
# sign_up and sign_in events. Enables hooking into the sign_up event.
def sign_up(resource_name, resource)
sign_in(resource_name, resource)
end
# Sign in a user that already was authenticated. This helper is useful for logging
# users in after sign up.
#

View file

@ -100,12 +100,6 @@ class ControllerAuthenticatableTest < ActionController::TestCase
@controller.sign_in(:user, user)
end
test 'sign up delegates to sign_in' do
user = User.new
@controller.expects(:sign_in).with(:user, user)
@controller.sign_up(:user, user)
end
test 'sign in accepts a resource as argument' do
user = User.new
@mock_warden.expects(:user).returns(nil)