Sha256: 8bbb8b8c7c0c2a45b1b3e2cad691111bf0fa79f5e2ae6cf02f86b92e310ad5af
Contents?: true
Size: 1.18 KB
Versions: 24
Compression:
Stored size: 1.18 KB
Contents
# frozen_string_literal: true require 'test_helper' class ConfirmableUserTest < ActiveSupport::TestCase describe ConfirmableUser do describe 'creation' do test 'email should be saved' do @resource = create(:confirmable_user) assert @resource.email.present? end end describe 'updating email' do test 'new email should be saved to unconfirmed_email' do @resource = create(:confirmable_user, email: 'old_address@example.com') @resource.update(email: 'new_address@example.com') assert @resource.unconfirmed_email == 'new_address@example.com' end test 'old email should be kept in email' do @resource = create(:confirmable_user, email: 'old_address@example.com') @resource.update(email: 'new_address@example.com') assert @resource.email == 'old_address@example.com' end test 'confirmation_token should be changed' do @resource = create(:confirmable_user, email: 'old_address@example.com') old_token = @resource.confirmation_token @resource.update(email: 'new_address@example.com') assert @resource.confirmation_token != old_token end end end end
Version data entries
24 entries across 24 versions & 6 rubygems