# Problem with assert\_redirected\_to

**URL:** <https://www.ruby-forum.com/t/problem-with-assert-redirected-to/183743>\
**Category:** Rails\
**Created:** [February 19, 2010, 10:38am UTC](https://www.ruby-forum.com/t/problem-with-assert-redirected-to/183743 "2010-02-19T10:38:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tekhne](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/90ced4/32.png) [@tekhne](https://www.ruby-forum.com/u/tekhne)\
**Post date:** [February 19, 2010, 10:38am UTC](https://www.ruby-forum.com/t/problem-with-assert-redirected-to/183743/1 "2010-02-19T10:38:55Z")

</div>

I have taken over some old Rails code and am trying to get the tests to  
run.  
In the functional test every time the assertion ‘assert\_redirected\_to’  
is  
called I get the following error:

test\_should\_update\_venue(VenuesControllerTest):  
NoMethodError: undefined method `[]’ for  
#Enumerable::Enumerator:0x102f747e0

/blah/blah/blah/project/vendor/rails/activerecord/lib/…/…/activesupport/lib/active\_support/core\_ext/string/access.rb:43:in  
`first’

/blah/blah/blah/project/vendor/rails/actionpack/lib/action\_controller/assertions/routing\_assertions.rb:131:in  
`recognized\_request\_for’

/blah/blah/blah/project/vendor/rails/actionpack/lib/action\_controller/assertions/response\_assertions.rb:70:in  
`assert\_redirected\_to’

/blah/blah/blah/project/vendor/rails/actionpack/lib/action\_controller/assertions/response\_assertions.rb:62:in  
`each’

/blah/blah/blah/project/vendor/rails/actionpack/lib/action\_controller/assertions/response\_assertions.rb:62:in  
`assert\_redirected\_to’

/blah/blah/blah/project/vendor/rails/actionpack/lib/action\_controller/assertions.rb:54:in  
`clean\_backtrace’

/blah/blah/blah/project/vendor/rails/actionpack/lib/action\_controller/assertions/response\_assertions.rb:54:in  
`assert\_redirected\_to’

It doesn’t matter what I do with the parameters to assert\_redirected\_to  
I  
always get the same error.

Anybody encountered this before?

Rails 2.0.2, Ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.0.0]

---

<div class="post-metadata">

**Author:** ![tekhne](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/90ced4/32.png) [@tekhne](https://www.ruby-forum.com/u/tekhne)\
**Post date:** [February 19, 2010, 11:31am UTC](https://www.ruby-forum.com/t/problem-with-assert-redirected-to/183743/2 "2010-02-19T11:31:36Z")

</div>

On Feb 19, 9:37 am, Peter H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I have taken over some old Rails code and am trying to get the tests to run.  
> In the functional test every time the assertion ‘assert\_redirected\_to’ is  
> called I get the following error:

Rails 2.0.2 isn;t compatible with ruby 1.8.7 - Rails 2.1 is the first  
version that was.

Fred

---

<div class="post-metadata">

**Author:** ![tekhne](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/90ced4/32.png) [@tekhne](https://www.ruby-forum.com/u/tekhne)\
**Post date:** [February 19, 2010, 11:33am UTC](https://www.ruby-forum.com/t/problem-with-assert-redirected-to/183743/3 "2010-02-19T11:33:22Z")

</div>

Damn I had that feeling, some of the code (and probably all the tests)  
was  
dragged in from a 2.1.1 project.

Thanks. I will have to look into upgrading the project.
