Last active
February 2, 2016 15:34
-
-
Save pinzolo/0b12b28838cd8f6805b3 to your computer and use it in GitHub Desktop.
Devise の confirmations_controller にて期間丁度に確認した場合、Mac, Linux での挙動が異なることの検証(修正コード)
This file contains 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
require 'test_helper' | |
class ConfirmationsControllerTest < ActionController::TestCase | |
setup do | |
@request.env['devise.mapping'] = Devise.mappings[:user] | |
end | |
test '登録して10日以内なら確認可' do | |
user = create(:user).reload | |
Time.stub(:now, user.confirmation_sent_at + 10.days) do | |
get :show, confirmation_token: user.confirmation_token | |
end | |
assert user.reload.confirmed? | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment