1
在我的Gemfile:在rail_root /测试/功能/ publisher_controller_test.rbMINITEST规格护栏出了问题,当我做一些功能测试
# -*- encoding : utf-8 -*-
describe PublisherController do
describe "GET #signin" do
it "responds successfully with an HTTP 200 status code" do
get :signin
assert_response :success
end
end
end
我的单元测试
group :test do
gem 'minitest-spec-rails'
end
我的测试文件工作得很好,但是当我运行
ruby -Itest test\functional\publisher_controller_test.rb"
它去错了,这里是错误:
test/functional/publisher_controller_test.rb:2:in `<main>':
uninitialized constant PublisherController (NameError).
我只是不知道为什么它可以找到我的模型,但找不到控制器。
这并没有为我工作,我仍然有错误:未初始化常量PublishersController(NameError)。 – Veetase
哦,该死!我错过了要求test_helper。 – Veetase