[rspec-users] ThreadError on click_button

Steve Scruggs lists at ruby-forum.com
Tue Nov 3 15:27:24 EST 2009


Steve Scruggs wrote:
> I get the following error
> 
> ThreadError in 'Managing InvoicePayments viewing index lists all
> InvoicePayments'
> stopping only thread
>   note: use sleep to stop forever
> (eval):2:in `click_button'
> 
> when running rake spec using rspec and rspec-rails 1.2.9 and webrat
> 0.5.3.  I have tried webrat 0.6.rc1 with the same results.
> 
> Here is the spec being executed:
> require 'spec_helper'
> 
> describe "Managing InvoicePayments" do
> 
>   describe "viewing index" do
>     it "lists all InvoicePayments" do
>      visit 'sessions/new'
>       fill_in "loginid", :with => "janepublic"
>       fill_in "password", :with => "janepub123"
>       click_button "Log in"
>     end
>   end
> end
> 
> 
> Any idea what could be causing this?

Found the issue, had to monkey-patch 
actionpack/lib/action_controller/integration.rb with the following:

           app = Rack::Lint.new(@application)
           status, headers, body = app.call(env)
+          body.close if body.respond_to?(:close)
+
           @request_count += 1

           @html_document = nil
-- 
Posted via http://www.ruby-forum.com/.


More information about the rspec-users mailing list