1
0
Fork 0
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:
Carlos A. da Silva 2009-10-10 10:17:51 -03:00
parent 7557ed147a
commit 2fbb56e8f7
2 changed files with 3 additions and 14 deletions

View file

@ -1,6 +1,5 @@
class ConfirmationsController < ApplicationController class ConfirmationsController < ApplicationController
skip_before_filter :authenticate! skip_before_filter :authenticate!
before_filter :require_no_authentication
# GET /confirmation/new # GET /confirmation/new
# #

View file

@ -2,17 +2,7 @@ require 'test/test_helper'
class ConfirmationsTest < ActionController::IntegrationTest class ConfirmationsTest < ActionController::IntegrationTest
test 'authenticated user should not be able to visit confirmation page' do test 'should be able to request a new confirmation' 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
user = create_user user = create_user
visit 'users/session/new' 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' assert_contain 'You will receive an email with instructions about how to confirm your account in a few minutes'
end 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') visit user_confirmation_path(:perishable_token => 'invalid_perishable')
assert_response :success assert_response :success
@ -36,7 +26,7 @@ class ConfirmationsTest < ActionController::IntegrationTest
assert_contain 'invalid confirmation' assert_contain 'invalid confirmation'
end 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) user = create_user(:confirm => false)
assert_not user.confirmed? assert_not user.confirmed?