-
-
Save braidn/b713c87758b3d62c4002 to your computer and use it in GitHub Desktop.
Minitest Rails Setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails::TestTask.new("test:features" => "test:prepare") do |t| | |
t.pattern = "test/features/*_test.rb" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#add to the Gemfile | |
group :test do | |
gem 'minitest-rails' | |
gem 'minitest-spec-expect' | |
gem 'minitest-reporters' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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