# Redirect fails

**URL:** <https://www.ruby-forum.com/t/redirect-fails/177945>\
**Category:** Rails\
**Created:** [October 27, 2009, 2:50am UTC](https://www.ruby-forum.com/t/redirect-fails/177945 "2009-10-27T02:50:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![slavix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b19c9b/32.png) [@slavix](https://www.ruby-forum.com/u/slavix)\
**Post date:** [October 27, 2009, 2:50am UTC](https://www.ruby-forum.com/t/redirect-fails/177945/1 "2009-10-27T02:50:07Z")

</div>

hello,  
I am testing an ActiveResource model create method. The remote service  
is sending back a redirect request with newly created record url, but  
for some reason redirection fails and I get

1. Error:  
test\_should\_create\_a\_sales\_quotation(SalesQuotationsControllerTest):  
ActiveResource::Redirection: Failed with 302 Moved temporarily =\>  
[http://vmsaps02.bramasol.com:8000/sap/rest/sales\_quotations/0020000234.xml](http://vmsaps02.bramasol.com:8000/sap/rest/sales_quotations/0020000234.xml)

I tried debugging the issue and found that for some reasone there were  
no rescue\_handlers for the exception… so the redirection does not  
happen and the test fails. I am lost as to why.

vendor/rails/activesupport/lib/active\_support/rescuable.rb  
76 end  
77  
78 def handler\_for\_rescue(exception)  
79 # We go from right to left because pairs are pushed onto  
rescue\_handlers  
80 # as rescue\_from declarations are found.  
=\> 81 \_, rescuer = Array(rescue\_handlers).reverse.detect do |  
klass\_name, handler|
