[rspec-users] [ANN] Webrat 0.1.0 released - Ruby Acceptance Testing for Web applications

David Chelimsky dchelimsky at gmail.com
Tue Dec 4 15:20:47 EST 2007


On Nov 30, 2007 3:28 PM, Jens-Christian Fischer
<jcfischer.lists at gmail.com> wrote:
> >
> > Code is available at: http://svn.eastmedia.net/public/plugins/webrat/
>
> > * Rails integration tests in Test::Unit _or_
> > * RSpec stories (using an RSpec version >= revision 2997)
>
> I had to add:
>
> require 'cgi'
> require "cgi/session"
> require 'cgi/session/pstore'
> require 'action_controller/cgi_ext/cgi_methods'

You could also apply this patch instead:

diff -r 80ee2d7fc95d -r 617747be70b6 vendor/plugins/webrat/lib/webrat/session.rb
--- a/vendor/plugins/webrat/lib/webrat/session.rb	Tue Dec 04 13:53:46 2007 -0600
+++ b/vendor/plugins/webrat/lib/webrat/session.rb	Tue Dec 04 14:04:50 2007 -0600
@@ -102,7 +102,12 @@ module ActionController

       def add_form_data(input_element, value) # :nodoc:
         form = form_for_node(input_element)
-        data =
CGIMethods::parse_query_parameters("#{input_element.attributes["name"]}=#{value}")
+        if defined?(CGIMethods)
+          parser = CGIMethods
+        else
+          parser = request.class
+        end
+        data =
parser.parse_query_parameters("#{input_element.attributes["name"]}=#{value}")
         merge_form_data(form_number(form), data)
       end





>
> in the beginning of lib/webrat/session.rb to get rid of the following
> error:
>
>     NameError: uninitialized constant
> ActionController::Integration::Session::CGIMethods
>      /Users/jcf/dev/work/quevita/vendor/rails/activerecord/lib/../../
> activesupport/lib/active_support/dependencies.rb:478:in `const_missing'
> /Users/jcf/dev/work/quevita/vendor/plugins/webrat/lib/webrat/
> session.rb:107:in `add_form_data'
> /Users/jcf/dev/work/quevita/vendor/plugins/webrat/lib/webrat/
> session.rb:175:in `add_default_params_for'
>
>
> nice work!
>
> Jens-Christian
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list