Skip to content

Instantly share code, notes, and snippets.

@pinzolo
Last active February 2, 2016 15:34
Show Gist options
  • Save pinzolo/0b12b28838cd8f6805b3 to your computer and use it in GitHub Desktop.
Save pinzolo/0b12b28838cd8f6805b3 to your computer and use it in GitHub Desktop.
Devise の confirmations_controller にて期間丁度に確認した場合、Mac, Linux での挙動が異なることの検証(修正コード)
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