【发布时间】:2012-07-26 17:57:51
【问题描述】:
我有没有测试的应用程序,现在我正在尝试添加它们(minitest-rails),但是出了点问题。
我正在输入rails generate controller test test
我有:
require "minitest_helper"
class TestControllerTest < MiniTest::Rails::ActionController::TestCase
test "should get test" do
get :test
assert_response :success
end
end
现在我正在输入 rake test 和 Expected response to be a <success>, but was <301> 发生错误。
问题出在哪里?
已编辑: 我的控制器代码:
class TestController < ApplicationController
def test
end
end
【问题讨论】:
-
@apneadiving 但为什么会发生任何重定向?
标签: ruby-on-rails ruby ruby-on-rails-3 testing minitest