【发布时间】:2015-04-29 13:38:09
【问题描述】:
我正在做 Hartle 教程,每次运行 rake test 时都会看到这个失败:
1) Failure:
StaticPagesControllerTest#test_should_get_help [.../sample_app/test/controllers/static_pages_controller_test.rb:14]:
<Help | Ruby on Rails Tutorial Sample App> expected but was
<Ruby on Rails Tutorial Sample App>..
Expected 0 to be >= 1.
这是什么意思?我该如何解决? 这是我的 static_pages_controller_test.rb 文件。
require 'test_helper'
class StaticPagesControllerTest < ActionController::TestCase
test "should get home" do
get :home
assert_response :success
assert_select "title", "Ruby on Rails Tutorial Sample App" end
test "should get help" do
get :help
assert_response :success
assert_select "title", "Help | Ruby on Rails Tutorial Sample App" end
test "should get about" do
get :about
assert_response :success
assert_select "title", "About | Ruby on Rails Tutorial Sample App" end
test "should get contact" do
get :contact
assert_response :success
assert_select "title", "Contact | Ruby on Rails Tutorial Sample App" end end
这是第 14 行。
assert_select "title", "Help | Ruby on Rails Tutorial Sample App"
【问题讨论】:
标签: ruby-on-rails ruby railstutorial.org