2

I am trying to write a test case of Rails' routing to redirect to another site.

For example:

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

The following attempt produced errors:

assert_routing "foo/123","http://othersite.com/foo/123"
JoshDM
  • 4,939
  • 7
  • 43
  • 72

1 Answers1

0

Based on this answer, I can suggest the same thing.

Did you try:

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

This works for you?

Community
  • 1
  • 1
Paladini
  • 4,522
  • 15
  • 53
  • 96