Sha256: 268a49b1d60f0a2d77a9e5138445a13d1533d858fac06ec80747eaf0a5413d7c

Contents?: true

Size: 728 Bytes

Versions: 9

Compression:

Stored size: 728 Bytes

Contents

class ActiveSupport::TestCase
  def setup_mailer
    Devise.mailer = Devise::Mailer
    ActionMailer::Base.deliveries = []
  end

  def store_translations(locale, translations, &block)
    begin
      I18n.backend.store_translations locale, translations
      yield
    ensure
      I18n.reload!
    end
  end

  # Helpers for creating new users
  #
  def generate_unique_email
    @@email_count ||= 0
    @@email_count += 1
    "test#{@@email_count}@email.com"
  end

  def valid_attributes(attributes={})
    { :email => generate_unique_email,
      :password => '123456',
      :password_confirmation => '123456' }.update(attributes)
  end

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

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
devise_invitable-1.7.5 test/model_tests_helper.rb
devise_invitable-1.7.4 test/model_tests_helper.rb
devise_invitable-1.7.3 test/model_tests_helper.rb
devise_invitable-1.7.2 test/model_tests_helper.rb
devise_invitable-1.7.1 test/model_tests_helper.rb
devise_invitable-1.7.0 test/model_tests_helper.rb
devise_invitable-1.6.1 test/model_tests_helper.rb
devise_invitable-1.6.0 test/model_tests_helper.rb
devise_invitable-1.5.5 test/model_tests_helper.rb