Sha256: ce508fd00adc22edc833e1fb6f4e8cb85c5ba92a5fc6abd14147ea38a59624da

Contents?: true

Size: 618 Bytes

Versions: 5

Compression:

Stored size: 618 Bytes

Contents

def valid_attributes(attributes={})
  { :username => "usertest",
    :email => generate_unique_email,
    :password => '123456',
    :password_confirmation => '123456' }.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

5 entries across 5 versions & 1 rubygems

Version Path
devise-async-0.5.1 test/support/helpers.rb
devise-async-0.5.0 test/support/helpers.rb
devise-async-0.4.0 test/support/helpers.rb
devise-async-0.3.1 test/support/helpers.rb
devise-async-0.3.0 test/support/helpers.rb