Sha256: 5638b32454939a4c6b9fcfd39b24d15e7607b135b162305b9c6f719c5d6dd160

Contents?: true

Size: 622 Bytes

Versions: 2

Compression:

Stored size: 622 Bytes

Contents

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

def generate_unique_email
  @@email_count ||= 0
  @@email_count += 1
  "test#{@@email_count}@example.com"
end

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

def create_user(attributes={})
  User.create!(valid_attributes(attributes))
end

def new_admin(attributes={})
  Admin.new(valid_attributes(attributes))
end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
devise-async-0.7.0 test/support/helpers.rb
devise-async-0.6.0 test/support/helpers.rb