Sha256: 9e4fc2abaabe5cebbc9ad737b37879f30e67ccd7691e168c9189f4f27a37b38a

Contents?: true

Size: 1.42 KB

Versions: 79

Compression:

Stored size: 1.42 KB

Contents

require 'simplecov'

ENV["RAILS_ENV"] = "test"
require File.expand_path("../dummy/config/environment.rb",  __FILE__)
require "rails/test_help"

Rails.backtrace_cleaner.remove_silencers!

# Load support files
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }

class ActiveSupport::TestCase
  # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
  #
  # Note: You'll currently still have to declare fixtures explicitly in integration tests
  # -- they do not yet inherit this setting
  fixtures :all

  # Add more helper methods to be used by all tests here...
end

class ActionController::TestCase
  include Devise::TestHelpers

  def login(resource)
    @request.env["devise.mapping"] = Devise.mappings[resource]
    sign_in(resource.class.name.downcase.to_sym, resource)
  end
end

class ActionDispatch::IntegrationTest
  def sign_in_as(user_template, password, email)
    user = User.create( password: password, password_confirmation: password, email: email,
                        first_name: user_template.first_name, last_name: user_template.last_name )
    user.save!
    user.update_column :status, user_template.status
    user.update_column :deleted, user_template.deleted?
    post_via_redirect 'users/login', user: { email: email, password: password }
    user
  end
end

module Rack
  module Test
    class UploadedFile
      def tempfile
        @tempfile
      end
    end
  end
end

Version data entries

79 entries across 79 versions & 1 rubygems

Version Path
contour-2.1.0.beta15 test/test_helper.rb
contour-2.1.0.beta14 test/test_helper.rb
contour-2.1.0.beta13 test/test_helper.rb
contour-2.1.0.beta12 test/test_helper.rb
contour-2.1.0.beta11 test/test_helper.rb
contour-2.1.0.beta10 test/test_helper.rb
contour-2.1.0.beta9 test/test_helper.rb
contour-2.1.0.beta8 test/test_helper.rb
contour-2.1.0.beta7 test/test_helper.rb
contour-2.1.0.beta6 test/test_helper.rb
contour-2.1.0.beta5 test/test_helper.rb
contour-2.1.0.beta4 test/test_helper.rb
contour-2.1.0.beta3 test/test_helper.rb
contour-2.1.0.beta2 test/test_helper.rb
contour-2.1.0.beta1 test/test_helper.rb
contour-2.0.0 test/test_helper.rb
contour-2.0.0.rc6 test/test_helper.rb
contour-2.0.0.rc5 test/test_helper.rb
contour-2.0.0.rc4 test/test_helper.rb
contour-2.0.0.rc3 test/test_helper.rb