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