Skip to content

Instantly share code, notes, and snippets.

@adamgamble
Created August 10, 2013 00:15
Show Gist options
  • Save adamgamble/6198360 to your computer and use it in GitHub Desktop.
Save adamgamble/6198360 to your computer and use it in GitHub Desktop.
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
require 'rails/test_help'
class ActiveSupport::TestCase
ActiveRecord::Migration.check_pending!
# Setup all fixtures in test/fixtures/*.yml 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...
def login_as(user)
@request.session[:user_id] = users(user).id
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment