Add ability to override redirect_to path after account confirmation.

This commit is contained in:
Simon Ernst
2011-07-08 11:21:01 +02:00
parent 90a5e2f9af
commit 517343ddb5
2 changed files with 16 additions and 1 deletions

View File

@@ -37,6 +37,15 @@ class ConfirmationTest < ActionController::IntegrationTest
assert user.reload.confirmed?
end
test 'user should be redirected to a custom path after confirmation' do
Devise::ConfirmationsController.any_instance.stubs(:after_confirmation_path_for).returns("/?custom=1")
user = create_user(:confirm => false)
visit_user_confirmation_with_token(user.confirmation_token)
assert_current_url "/?custom=1"
end
test 'already confirmed user should not be able to confirm the account again' do
user = create_user(:confirm => false)
user.confirmed_at = Time.now