Allows assert_redirected_to to accept a regular expression #3792

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
Contributor

alindeman commented Nov 29, 2011

I have a few places where I really only care to assert that the URL matches a regular expression.

This patch allows it while keeping the semantics the same when a String or Hash is passed to assert_redirect_to

@vijaydev vijaydev and 1 other commented on an outdated diff Nov 29, 2011

...ck/lib/action_dispatch/testing/assertions/response.rb
@@ -54,14 +54,17 @@ module ActionDispatch
# # assert that the redirection was to the url for @customer
# assert_redirected_to @customer
#
+ # # asserts that the redirection matches the regular expression
+ # assert_redirect_to %r(^http://example.com)
@vijaydev

vijaydev Nov 29, 2011

Member

must be assert_redirected_to

@alindeman

alindeman Nov 29, 2011

Contributor

Thanks: fixed and updated pull request.

Contributor

alindeman commented Dec 1, 2011

Squashed and rebased.

Contributor

alindeman commented Jan 18, 2012

Is this acceptable at all?

Member

sikachu commented Apr 28, 2012

Going to bring this one up a notch. Can you please rebase your pull request, as it's not cleanly merge, adding CHANGELOG entry for this, maybe adding guide where appropriate, and force push the commit to your branch? Thanks a bunch.

Contributor

alindeman commented Apr 29, 2012

Thanks. I'll do it over the next few days.

Contributor

alindeman commented May 3, 2012

Unfortunately I had deleted my branch. Opened a new request at #6135.

alindeman closed this May 3, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment