Skip to content

Instantly share code, notes, and snippets.

@julesfern
Created October 30, 2008 12:34
Show Gist options
  • Save julesfern/20984 to your computer and use it in GitHub Desktop.
Save julesfern/20984 to your computer and use it in GitHub Desktop.
# 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