Skip to content
This repository has been archived by the owner on Nov 15, 2018. It is now read-only.

polarlights/minitest-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

This project is based on Railscasts #327 MiniTest with Rails (revised), but time is passing by, some gems are deprecated, some are born.

Important Code

ENV['RAILS_ENV'] = 'test'
require File.expand_path('../../config/environment', __FILE__)
require 'minitest/autorun'
require 'capybara/rails'
require 'active_support/testing/setup_and_teardown'
require "minitest/reporters"

#https://github.com/kern/minitest-reporters

Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new

class IntegrationTest < Minitest::Spec
  include Rails.application.routes.url_helpers
  include Capybara::DSL
  register_spec_type(/integration$/, self)
end

class HelperTest < Minitest::Spec
  include ActiveSupport::Testing::SetupAndTeardown
  include ActionView::TestCase::Behavior
  register_spec_type(/Helper$/, self)
end