Sha256: b1185aee7ebbde9981ad77da23c916293c97cb5d5ec9da082247909b2b20db22
Contents?: true
Size: 569 Bytes
Versions: 12
Compression:
Stored size: 569 Bytes
Contents
module Support module Factories def generate_unique_email @@email_count ||= 0 @@email_count += 1 "test#{@@email_count}@example.com" end def valid_attributes(attributes={}) { :username => "usertest", :email => generate_unique_email, :password => '123456', :password_confirmation => '123456' }.update(attributes) end def create_admin(attributes={}) valid_attributes = valid_attributes(attributes) valid_attributes.delete(:username) Admin.create!(valid_attributes) end end end
Version data entries
12 entries across 12 versions & 3 rubygems