minitest-rails gem으로 매우 간단한 테스트를 실행할 때 오류가 발생했습니다. 내가 레일 4.1.5 및 minitest 5.4.0Minitest - NoMethodError : 정의되지 않은 메소드`get '
레이크 시험이 : 컨트롤러
를1) 오류 : DashboardController :: index 액션 번호의 test_0001_anonymous : NoMethodError : 정의되지 않은 메서드 get' for #<#<Class:0x00000008e28170>:0x00000008eeb9b8> test/controllers/dashboard_controller_test.rb:6:in
블록 (3 단계)에서 '
테스트 :
require "test_helper"
describe DashboardController do
context "index action" do
before do
get :index
end
it { must_respond_with :success }
it "must render index view" do
must_render_template :index
end
end
end
내 test_helper :
,ENV["RAILS_ENV"] = "test"
require File.expand_path("../../config/environment", __FILE__)
require "rails/test_help"
require "minitest/rails"
require "minitest/rails/capybara"
class MiniTest::Spec
class << self
alias :context :describe
end
end
class RequestTest < MiniTest::Spec
include Rails.application.routes.url_helpers
register_spec_type(/request$/, self)
end
class ActionDispatch::IntegrationTest
# Register "request" tests to be handled by IntegrationTest
register_spec_type(/Request(?Test)?\z/i, self)
end
class ActiveSupport::TestCase
ActiveRecord::Migration.check_pending!
# Setup all fixtures in test/fixtures/*.(yml|csv) 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...
extend MiniTest::Spec::DSL
end
필요하신 분 [this] (http://stackoverflow.com/questions/11667552/minitest-undefined-method-get) – dddd1919