2

我正在尝试编写 Rails 路由的测试用例以重定向到另一个站点。

例如:

get "foo/:id",redirect("http://othersite.com/foo/%{id}",:status => 301)

以下尝试产生了错误:

assert_routing "foo/123","http://othersite.com/foo/123"
4

1 回答 1

0

基于这个答案,我可以提出同样的建议。

你试过了吗:

match "/blog" => redirect("http://example.com/blog"), :as => :blog

这对你有用吗?

于 2014-01-29T22:03:34.287 回答