使用rails generate integration_test static_pages
生成的static_pages_spec.rb
文件,代码中有
get static_pages_index_path
response.status.should be(200)
但测试的时候提示没有 static_pages_index_path 方法?这个是什么情况?
F.
Failures:
1) StaticPages GET /static_pages works! (now write some real specs)
Failure/Error: get static_pages_index_path
NameError:
undefined local variable or method `static_pages_index_path' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_1:0x007fba87318050>
# ./spec/requests/static_pages_spec.rb:7:in `block (3 levels) in <top (required)>'
Finished in 0.10695 seconds
2 examples, 1 failure
Failed examples:
rspec ./spec/requests/static_pages_spec.rb:5 # StaticPages GET /static_pages works! (now write some real specs)