Sha256: c273c2d5e64f4e8b537158976502281c3042cec404959838905746af4c49d03d

Contents?: true

Size: 483 Bytes

Versions: 10

Compression:

Stored size: 483 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

10 entries across 10 versions & 3 rubygems

Version Path
devise-otp-0.4.0 test/model_tests_helper.rb
devise-otp-0.3.0 test/model_tests_helper.rb
devise-otp2-0.2.6 test/model_tests_helper.rb
devise-otp2-0.2.5 test/model_tests_helper.rb
devise-otp2-0.2.4 test/model_tests_helper.rb
devise-otp-rails5-0.2.4 test/model_tests_helper.rb
devise-otp-0.2.3 test/model_tests_helper.rb
devise-otp-0.2.2 test/model_tests_helper.rb
devise-otp-0.2.0 test/model_tests_helper.rb
devise-otp-0.1.1 test/model_tests_helper.rb