Sha256: f9ba641ce0e6a5da23316e23a59b116fbe960330f0f6b4e1b321c7f405390b91

Contents?: true

Size: 1.54 KB

Versions: 10

Compression:

Stored size: 1.54 KB

Contents

require 'simplecov'

require 'minitest/autorun'
require 'minitest/reporters'
Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new

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

10 entries across 10 versions & 1 rubygems

Version Path
contour-3.0.0.beta1 test/test_helper.rb
contour-2.7.0 test/test_helper.rb
contour-2.7.0.beta1 test/test_helper.rb
contour-2.6.0 test/test_helper.rb
contour-2.6.0.rc test/test_helper.rb
contour-2.6.0.beta8 test/test_helper.rb
contour-2.6.0.beta7 test/test_helper.rb
contour-2.6.0.beta6 test/test_helper.rb
contour-2.6.0.beta5 test/test_helper.rb
contour-2.6.0.beta4 test/test_helper.rb