水豚和路线参数

时间:2012-04-17 00:51:17

标签: ruby-on-rails-3 capybara

我有一个Rails 3.0.10应用程序,其中一些前端表单使用路由参数 但我一直坚持如何让水豚参观那些充满活力的道路。

的routes.rb

match "weather/:region/:reporter" => "weather#new", :as => 'weather_report'

在我的集成测试中,我有以下内容:

visit weather_report_path(:region => 'north', :reporter => 'alex' )

这给了我一个

NoMethodError:
       undefined method `weather_report' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_1:0x007f97084a3e08>

如果我试图在集成测试中硬编码路径

ex:visit 'weather/southeast/alex'

capybara进入主页...

非常感谢任何正确指导。

0 个答案:

没有答案