Created
October 30, 2008 12:34
-
-
Save julesfern/20984 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Override for buggy freaking redirect_to assertion in merb 0.9.11. | |
# duplicates syntax of old version, so can be safely removed once | |
# http://merb.lighthouseapp.com/projects/7433-merb/tickets/949-redirect_to-assertion-errors-on-success-under-some-setups | |
# is fixed. | |
def redirect_to(url) | |
simple_matcher("redirect to #{url.inspect}") do |controller, matcher| | |
actual_url = controller.rack_response[1]["Location"] | |
matcher.failure_message = "expected to be redirected to #{url.inspect} but instead was redirected to #{actual_url.inspect}" | |
actual_url == url | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment