Sha256: defa67bce859dbcc4642e10db65115fb047c73af9527dd93ea3a526f8706c707
Contents?: true
Size: 1011 Bytes
Versions: 8
Compression:
Stored size: 1011 Bytes
Contents
require "test_helper" class Identity::EmailVerificationsControllerTest < ActionDispatch::IntegrationTest setup do @user = sign_in_as(users(:lazaro_nixon)) @user.update! verified: false end test "should send a verification email" do assert_enqueued_email_with UserMailer, :email_verification, args: { user: @user } do post identity_email_verification_url end assert_redirected_to root_url end test "should verify email" do sid = @user.create_email_verification_token.signed_id(expires_in: 2.days) get edit_identity_email_verification_url(sid: sid, email: @user.email) assert_redirected_to root_url end test "should not verify email with expired token" do sid_exp = @user.create_email_verification_token.signed_id(expires_in: 0.minutes) get edit_identity_email_verification_url(sid: sid_exp, email: @user.email) assert_redirected_to edit_identity_email_url assert_equal "That email verification link is invalid", flash[:alert] end end
Version data entries
8 entries across 8 versions & 1 rubygems