Skip to content

Instantly share code, notes, and snippets.

@braidn
Created August 3, 2014 19:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save braidn/b713c87758b3d62c4002 to your computer and use it in GitHub Desktop.
Save braidn/b713c87758b3d62c4002 to your computer and use it in GitHub Desktop.
Minitest Rails Setup
#add to this file under the application class
config.generators do |g|
g.test_framework :minitest, spec: true, fixture: false
g.helper false
g.assets false
g.view_specs false
g.integration_specs false
end
Rails::TestTask.new("test:features" => "test:prepare") do |t|
t.pattern = "test/features/*_test.rb"
end
#add to the Gemfile
group :test do
gem 'minitest-rails'
gem 'minitest-spec-expect'
gem 'minitest-reporters'
end
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
require 'minitest/reporters'
require 'minitest/spec/expect'
require "minitest/rails"
Minitest::Reporters.use!
class ActiveSupport::TestCase
# 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...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment