我正在做Hartle教程并且每次运行rake测试时看到这个失败我看到这个失败:
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"
解决方法
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。