我正在试图让我的测试枯竭,并想检查路线。 app.send(“home_path”)在控制台中返回“/ home”,但是当我在测试中运行它时,它会以未定义的方式返回。
有什么想法吗?
1) StaticPages Check paths should have content Home
Failure/Error: visit app.send("#{term.downcase}_path")
NoMethodError:
undefined method `home_path' for #<test::Application:0x007f917a48e078>
# ./spec/requests/static_pages_spec.rb:18:in `block (4 levels) in <top (required)>'
["Home", "About"].each do |term|
describe "Check paths" do
before(:each) do
visit app.send("#{term.downcase}_path")
end
it "should have content #{term}" do
expect(page).to have_content(term)
end
end
end