1
当我试图找到test_helper文件时,我的测试失败。无法找到我的test_helper文件(LoadError)
我的文件:
require File.dirname(__FILE__) + '/../test_helper'
require 'admin/supplier_controller'
#Re-raise errors caugth by the controller
class Admin::SupplierController; def rescue_action(e) raise e end; end
class Admin::SupplierControllerTest < ActionController::TestCase
fixtures :suppliers
def setup
@controller = Admin::SupplierController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
end
def test_new
get :new
assert_template 'admin/supplier/new'
assert_tag 'h1', :content => 'Create new supplier'
assert_tag 'form', :attributes => {:action => '/admin/supplier/create'}
end
end
难道说'test_helper.rb'是你试图运行上面的文件_not_一个文件夹? –
'test_helper'位于哪里,你在哪里访问它? –