[Radiant] Re: undefined method `match' - when testing extension features with cucumber and webrat
I needed to use rack 1.1 or greater, so I patched part of the process method in module ActionController::Integration::Session like so: set_cookie_header_prepared = @headers['Set-Cookie'].is_a?(String) ? @headers['Set-Cookie'] : @headers['Set- Cookie'].join() (set_cookie_header_prepared || ).split(\n).each do |cookie| # Patched to be compatible with rack 1.0.1 !! name, value = cookie.match(/^([^=]*)=([^;]*);/)[1,2] @cookies[name] = value end Now my test work fine! On 22 Dez. 2010, 01:58, Enrico Teotti enrico.teo...@gmail.com wrote: Hi Stan, today when I was running my cuke features on a Rails app I had exactly the same problem you had. undefined method `match' for #Array:0x10a770a78 (NoMethodError) This was a fresh install, the same features were running fine on my office workstation. These are the gems of my Rails (2.3.4) app: http://pastie.org/1396577 And after two hours of hammering my head, and right before deciding to stop working in IT and open a bar on a lonely beach on a remote island... I found out that the error was caused by: rack (1.2.1) rolling it back to rack 1.0 (and even 1.0.1) solved the problem for me. It's not a Radiant related problem, but I really hope by posting my solution I'll save some time to the future generation (I hope nobody) who might incur in this cryptic problem, Regards, Enrico -- Enrico Teotti IT consultant, accessible web sites and web applications currently working @http://www.redant.com.au Sydney, NSW, Australia enrico.teo...@gmail.com mobile (AU) +00610416748450 http://teotti.com
Re: [Radiant] Re: undefined method `match' - when testing extension features with cucumber and webrat
Hi Stan, today when I was running my cuke features on a Rails app I had exactly the same problem you had. undefined method `match' for #Array:0x10a770a78 (NoMethodError) This was a fresh install, the same features were running fine on my office workstation. These are the gems of my Rails (2.3.4) app: http://pastie.org/1396577 And after two hours of hammering my head, and right before deciding to stop working in IT and open a bar on a lonely beach on a remote island... I found out that the error was caused by: rack (1.2.1) rolling it back to rack 1.0 (and even 1.0.1) solved the problem for me. It's not a Radiant related problem, but I really hope by posting my solution I'll save some time to the future generation (I hope nobody) who might incur in this cryptic problem, Regards, Enrico -- Enrico Teotti IT consultant, accessible web sites and web applications currently working @ http://www.redant.com.au Sydney, NSW, Australia enrico.teo...@gmail.com mobile (AU) +00610416748450 http://teotti.com
[Radiant] Re: undefined method `match' - when testing extension features with cucumber and webrat
If anyone has *any* insight or suggestions, that would be SUPER helpful. Thanks, STan On Oct 5, 8:08 am, Stan Rawrysz smoo...@gmail.com wrote: Beat my head against the wall with this problem all day yesterday. Not sure what's going on. I'm running Radiant 0.8.2 (along with webrat 0.4.4, cucumber 0.3.9) I'm writing an extension and trying to implement some features. When I run the features, I get the following error: (maybe easier to read here -http://pastie.org/1200872) undefined method `match' for #Array:0x7f9f8e2aee98 (NoMethodError) /home/stanr/projects/radiantapp/cms_core/vendor/radiant/vendor/rails/action pack/lib/action_controller/integration.rb:324:in `process' /home/stanr/projects/radiantapp/cms_core/vendor/radiant/vendor/rails/action pack/lib/action_controller/integration.rb:323:in `each' /home/stanr/projects/radiantapp/cms_core/vendor/radiant/vendor/rails/action pack/lib/action_controller/integration.rb:323:in `process' /home/stanr/projects/radiantapp/cms_core/vendor/radiant/vendor/rails/action pack/lib/action_controller/integration.rb:196:in `get' /home/stanr/projects/radiantapp/cms_core/vendor/radiant/vendor/rails/action pack/lib/action_controller/integration.rb:491:in `__send__' /home/stanr/projects/radiantapp/cms_core/vendor/radiant/vendor/rails/action pack/lib/action_controller/integration.rb:491:in `get' /usr/lib/ruby/gems/1.8/gems/webrat-0.4.4/lib/webrat/rails.rb:70:in `send' /usr/lib/ruby/gems/1.8/gems/webrat-0.4.4/lib/webrat/rails.rb:70:in `do_request' /usr/lib/ruby/gems/1.8/gems/webrat-0.4.4/lib/webrat/rails.rb:35:in `get' /usr/lib/ruby/gems/1.8/gems/webrat-0.4.4/lib/webrat/core/session.rb:106:in `send' /usr/lib/ruby/gems/1.8/gems/webrat-0.4.4/lib/webrat/core/session.rb:106:in `request_page' /usr/lib/ruby/gems/1.8/gems/webrat-0.4.4/lib/webrat/core/session.rb:205:in `visit' (eval):2:in `visit' /home/stanr/projects/radiantapp/cms_core/vendor/extensions/ip_redirect/feat ures/step_definitions/customer_comes_to_us_helios_steps.rb:18 /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/core_ext/ins tance_exec.rb:20:in `instance_exec' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/core_ext/ins tance_exec.rb:20:in `cucumber_instance_exec' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/core_ext/ins tance_exec.rb:38:in `cucumber_run_with_backtrace_filtering' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/core_ext/ins tance_exec.rb:10:in `cucumber_instance_exec' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/step_definit ion.rb:105:in `invoke' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/step_match.r b:12:in `invoke' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/ast/step_inv ocation.rb:36:in `invoke' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/ast/step_inv ocation.rb:22:in `accept' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/ast/visitor. rb:74:in `visit_step' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/formatter/pr etty.rb:128:in `visit_step' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/ast/step_col lection.rb:14:in `accept' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/ast/step_col lection.rb:13:in `each' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/ast/step_col lection.rb:13:in `accept' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/ast/visitor. rb:70:in `visit_steps' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/ast/scenario .rb:31:in `accept' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/step_mother. rb:249:in `before_and_after' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/ast/scenario .rb:30:in `accept' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/ast/visitor. rb:45:in `visit_feature_element' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/formatter/pr etty.rb:80:in `visit_feature_element' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/ast/feature. rb:23:in `accept' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/ast/feature. rb:22:in `each' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/ast/feature. rb:22:in `accept' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/ast/visitor. rb:23:in `visit_feature' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/formatter/pr etty.rb:41:in `visit_feature'
Re: [Radiant] Re: undefined method `match' - when testing extension features with cucumber and webrat
Have you look at at this file? /home/stanr/projects/radiantapp/cms_core/vendor/extensions/ip_redirect/features/step_definitions/customer_comes_to_us_helios_steps.rb:18 On Wed, Oct 6, 2010 at 11:51 AM, Stan Rawrysz smoo...@gmail.com wrote: If anyone has *any* insight or suggestions, that would be SUPER helpful. Thanks, STan On Oct 5, 8:08 am, Stan Rawrysz smoo...@gmail.com wrote: Beat my head against the wall with this problem all day yesterday. Not sure what's going on. I'm running Radiant 0.8.2 (along with webrat 0.4.4, cucumber 0.3.9) I'm writing an extension and trying to implement some features. When I run the features, I get the following error: (maybe easier to read here -http://pastie.org/1200872) undefined method `match' for #Array:0x7f9f8e2aee98 (NoMethodError) /home/stanr/projects/radiantapp/cms_core/vendor/radiant/vendor/rails/action pack/lib/action_controller/integration.rb:324:in `process' /home/stanr/projects/radiantapp/cms_core/vendor/radiant/vendor/rails/action pack/lib/action_controller/integration.rb:323:in `each' /home/stanr/projects/radiantapp/cms_core/vendor/radiant/vendor/rails/action pack/lib/action_controller/integration.rb:323:in `process' /home/stanr/projects/radiantapp/cms_core/vendor/radiant/vendor/rails/action pack/lib/action_controller/integration.rb:196:in `get' /home/stanr/projects/radiantapp/cms_core/vendor/radiant/vendor/rails/action pack/lib/action_controller/integration.rb:491:in `__send__' /home/stanr/projects/radiantapp/cms_core/vendor/radiant/vendor/rails/action pack/lib/action_controller/integration.rb:491:in `get' /usr/lib/ruby/gems/1.8/gems/webrat-0.4.4/lib/webrat/rails.rb:70:in `send' /usr/lib/ruby/gems/1.8/gems/webrat-0.4.4/lib/webrat/rails.rb:70:in `do_request' /usr/lib/ruby/gems/1.8/gems/webrat-0.4.4/lib/webrat/rails.rb:35:in `get' /usr/lib/ruby/gems/1.8/gems/webrat-0.4.4/lib/webrat/core/session.rb:106:in `send' /usr/lib/ruby/gems/1.8/gems/webrat-0.4.4/lib/webrat/core/session.rb:106:in `request_page' /usr/lib/ruby/gems/1.8/gems/webrat-0.4.4/lib/webrat/core/session.rb:205:in `visit' (eval):2:in `visit' /home/stanr/projects/radiantapp/cms_core/vendor/extensions/ip_redirect/feat ures/step_definitions/customer_comes_to_us_helios_steps.rb:18 /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/core_ext/ins tance_exec.rb:20:in `instance_exec' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/core_ext/ins tance_exec.rb:20:in `cucumber_instance_exec' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/core_ext/ins tance_exec.rb:38:in `cucumber_run_with_backtrace_filtering' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/core_ext/ins tance_exec.rb:10:in `cucumber_instance_exec' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/step_definit ion.rb:105:in `invoke' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/step_match.r b:12:in `invoke' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/ast/step_inv ocation.rb:36:in `invoke' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/ast/step_inv ocation.rb:22:in `accept' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/ast/visitor. rb:74:in `visit_step' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/formatter/pr etty.rb:128:in `visit_step' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/ast/step_col lection.rb:14:in `accept' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/ast/step_col lection.rb:13:in `each' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/ast/step_col lection.rb:13:in `accept' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/ast/visitor. rb:70:in `visit_steps' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/ast/scenario .rb:31:in `accept' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/step_mother. rb:249:in `before_and_after' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/ast/scenario .rb:30:in `accept' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/ast/visitor. rb:45:in `visit_feature_element' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/formatter/pr etty.rb:80:in `visit_feature_element' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/ast/feature. rb:23:in `accept' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/ast/feature. rb:22:in `each' /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.9/bin/../lib/cucumber/ast/feature. rb:22:in `accept'
[Radiant] Re: undefined method `match' - when testing extension features with cucumber and webrat
I had a similar issue when I was moving extensions from dev-server to production. One of the issues was that I had a typo in the migration scripts and one of the table fields was misnamed when migration was executed. So when I attempted to retrieve data from it, it had that same error regarding match method. Another issue I ran into is when in one of my models (Subscriber) I specifically refer to another model (like Role.all) either through a conditions hash in a named_scope or via a custom validation rule. Just my experience. Check the lines from your code that the error log refers to. That should give you a good idea what went wrong.