Sha256: 90622b70d249e85d0bc91755ccf1ab29c703b9fd22b9353804e61d0459b13f85

Contents?: true

Size: 476 Bytes

Versions: 2

Compression:

Stored size: 476 Bytes

Contents

class ActiveSupport::TestCase
  #
  # Helpers for creating new users
  #
  def unique_identity
    @@unique_identity_count ||= 0
    @@unique_identity_count += 1
    "user-#{@@unique_identity_count}@mail.invalid"
  end

  def valid_attributes(attributes = {})
    { email: unique_identity,
      password: '12345678',
      password_confirmation: '12345678' }.update(attributes)
  end

  def new_user(attributes = {})
    User.new(valid_attributes(attributes)).save
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
devise-2fa-0.1.1 test/model_tests_helper.rb
devise-2fa-0.1.0 test/model_tests_helper.rb