Skip to content

Instantly share code, notes, and snippets.

@frankolson
Created October 27, 2018 01:03
Show Gist options
  • Save frankolson/1f3c6ca5744b28d09eef6d0e410d8e41 to your computer and use it in GitHub Desktop.
Save frankolson/1f3c6ca5744b28d09eef6d0e410d8e41 to your computer and use it in GitHub Desktop.
Auto-load support files into your test helper
# test/test_helper.rb
ENV['RAILS_ENV'] ||= 'test'
require_relative '../config/environment'
require 'rails/test_help'
# Be sure to add this line to include all support files
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
class ActiveSupport::TestCase
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
fixtures :all
# Add more helper methods to be used by all tests here...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment