Sha256: fb50d8a0d8fab56bfb71d557b3edb0b3e7f6f812746a1d2d4a0922a246f94f7b

Contents?: true

Size: 438 Bytes

Versions: 2

Compression:

Stored size: 438 Bytes

Contents

module TestHelpers
  def valid_attributes(attributes={})
    { username: "usertest",
      email: generate_unique_email,
      password: '12345678',
      password_confirmation: '12345678'
    }.update(attributes)
  end

  email_count = 0
  define_method :generate_unique_email do
    email_count += 1
    "test#{email_count}@example.com"
  end

  def create_admin(attributes={})
    Admin.create!(valid_attributes(attributes))
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
devise-async-1.0.0 spec/support/test_helpers.rb
devise-async-1.0.0beta spec/support/test_helpers.rb