Skip to content

Commit

Permalink
bugfix: when h was nil (which it was for all my tests), everyone woul…
Browse files Browse the repository at this point in the history
…d fail with nil.[]= errors. Making sure we at least have a blank hash fixes this.
  • Loading branch information
Kieran Pilkington authored and joshknowles committed Dec 30, 2008
1 parent 2562942 commit 0938c6d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/webrat/rails.rb
Expand Up @@ -91,6 +91,7 @@ def internal_redirect?
def follow_redirect_with_headers(h = {})
raise "Not a redirect! #{@status} #{@status_message}" unless redirect?

h = Hash.new if h.nil?
h['HTTP_REFERER'] = request.url

location = headers["location"]
Expand Down

0 comments on commit 0938c6d

Please sign in to comment.