mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Removing no_authentication in confirmations
This commit is contained in:
parent
7557ed147a
commit
2fbb56e8f7
2 changed files with 3 additions and 14 deletions
|
@ -1,6 +1,5 @@
|
|||
class ConfirmationsController < ApplicationController
|
||||
skip_before_filter :authenticate!
|
||||
before_filter :require_no_authentication
|
||||
|
||||
# GET /confirmation/new
|
||||
#
|
||||
|
|
|
@ -2,17 +2,7 @@ require 'test/test_helper'
|
|||
|
||||
class ConfirmationsTest < ActionController::IntegrationTest
|
||||
|
||||
test 'authenticated user should not be able to visit confirmation page' do
|
||||
sign_in
|
||||
|
||||
get new_user_confirmation_path
|
||||
|
||||
assert_response :redirect
|
||||
assert_redirected_to root_path
|
||||
assert warden.authenticated?
|
||||
end
|
||||
|
||||
test 'not authenticated user should be able to request a new confirmation' do
|
||||
test 'should be able to request a new confirmation' do
|
||||
user = create_user
|
||||
|
||||
visit 'users/session/new'
|
||||
|
@ -27,7 +17,7 @@ class ConfirmationsTest < ActionController::IntegrationTest
|
|||
assert_contain 'You will receive an email with instructions about how to confirm your account in a few minutes'
|
||||
end
|
||||
|
||||
test 'not authenticated user with invalid perishable token should not be able to confirm an account' do
|
||||
test 'with invalid perishable token should not be able to confirm an account' do
|
||||
visit user_confirmation_path(:perishable_token => 'invalid_perishable')
|
||||
|
||||
assert_response :success
|
||||
|
@ -36,7 +26,7 @@ class ConfirmationsTest < ActionController::IntegrationTest
|
|||
assert_contain 'invalid confirmation'
|
||||
end
|
||||
|
||||
test 'not authenticated user with valid perishable token should be able to confirm an account' do
|
||||
test 'with valid perishable token should be able to confirm an account' do
|
||||
user = create_user(:confirm => false)
|
||||
assert_not user.confirmed?
|
||||
|
||||
|
|
Loading…
Reference in a new issue