【发布时间】:2016-05-21 09:55:33
【问题描述】:
我不断收到错误:
NoMethodError:未定义的方法“full_title”。
在我的 test/integration/site_layout_test.rb 文件中,我有以下代码:
require 'test_helper'
class SiteLayoutTest < ActionDispatch::IntegrationTest
test "layout links" do
get root_path
assert_template 'static_pages/home'
assert_select "a[href=?]", root_path
assert_select "a[href=?]", help_path
assert_select "a[href=?]", about_path
assert_select "a[href=?]", contact_path
get signup_path
assert_select "title", full_title("Sign up")
end
end
当我删除 assert_select "title", full_title("Sign up") 并运行 Guard 时,测试是绿色的,但是当我把它放回去时,我得到了错误。我该如何解决?
【问题讨论】:
标签: ruby-on-rails railstutorial.org