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] -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Feb 19, 9:37 am, Peter Hickman <peterhickman...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> 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> > test_should_update_venue(VenuesControllerTest): > NoMethodError: undefined method `[]'' for > #<Enumerable::Enumerator:0x102f747e0> > > /blah/blah/blah/project/vendor/rails/activerecord/lib/../../activesupport/l ib/active_support/core_ext/string/access.rb:43:in > `first'' > > /blah/blah/blah/project/vendor/rails/actionpack/lib/action_controller/asser tions/routing_assertions.rb:131:in > `recognized_request_for'' > > /blah/blah/blah/project/vendor/rails/actionpack/lib/action_controller/asser tions/response_assertions.rb:70:in > `assert_redirected_to'' > > /blah/blah/blah/project/vendor/rails/actionpack/lib/action_controller/asser tions/response_assertions.rb:62:in > `each'' > > /blah/blah/blah/project/vendor/rails/actionpack/lib/action_controller/asser tions/response_assertions.rb:62:in > `assert_redirected_to'' > > /blah/blah/blah/project/vendor/rails/actionpack/lib/action_controller/asser tions.rb:54:in > `clean_backtrace'' > > /blah/blah/blah/project/vendor/rails/actionpack/lib/action_controller/asser tions/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]-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
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. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.