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

Version Path
devise_inactivatable-1.0.3 test/support/factories.rb
devise-encryptable-0.2.0 test/support/factories.rb
devise_inactivatable-1.0.2 test/support/factories.rb
devise-encryptable-0.1.2 test/support/factories.rb
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/devise-encryptable-0.1.1/test/support/factories.rb
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/devise-encryptable-0.1.1/test/support/factories.rb
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/devise-encryptable-0.1.1/test/support/factories.rb
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/devise-encryptable-0.1.1/test/support/factories.rb
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/devise-encryptable-0.1.1/test/support/factories.rb
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/devise-encryptable-0.1.1/test/support/factories.rb
devise-encryptable-0.1.1 test/support/factories.rb
devise-encryptable-0.1.0 test/support/factories.rb