Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

assert_redirected_to doesn't support regular expression matching

#3439

The assert_redirected_to testing assertion does not properly match against regular expressions. In fact, I'm currently seeing the following error:

def test_redirect
  get :index
  assert_redirect_to %r{fubar}
end

# 1) Error:
# NoMethodError: undefined method `regexp_url' for #<FooController:0x111111>

I'll likely take a stab at a patch, shortly, just wanted to make the ticket.

Reported by Nathaniel Bibler · October 29th, 2009 @ 03:44 PM

State: invalid
Milestone: none
Assigned to: Ryan Bigg Ryan Bigg
Importance: none

Activity

  1. David Trasbo
    David Trasbo
    • Assigned user set to Ryan Bigg

    Nathaniel,

    According to the documentation of assert_redirected_to the method isn't supposed to support regular expressions - I think the error you're seeing is a side effect of that.

    If you think regular expressions should be supported please do post a ticket with a patch. This ticket, however, can be marked as invalid.

    April 14th, 2010 @ 09:29 PM

  2. Ryan Bigg
    Ryan Bigg
    • State changed from new to invalid

    April 14th, 2010 @ 09:37 PM