#141 open
Justin Smestad

merb_cucumber broken with webrat 0.4

Reported by Justin Smestad | January 22nd, 2009 @ 02:33 PM | in 0.4.2

Using merb_cucumber and webrat 0.4 causes any of the result_steps.rb to error with:

undefined local variable or method response' for #<Merb::Test::World::Webrat:0x273d014> (NameError)

This issue does not occur with webrat 0.3.2 I have also contacted david, merb_cucumber developer, about this problem also.

Comments and changes to this ticket

  • Lindsay Holmwood

    Lindsay Holmwood January 23rd, 2009 @ 01:31 AM

    There's been a bit of reworking within Webrat::Methods, and the response method no longer exists.

    I'm guessing you're using response to poke at response body, like this:

    response.body.should <something>
    
    

    There's a method specifically for getting at the response body now, so you can just do:

    response_body.should <something>
    
    

    You can use this quick shell fragment to update your tests:

    cd $your_features_directory
    for step in $(grep response\.body * -R |cut -d ':' -f 1 |uniq); do 
      sed -i 's#response\.body#response_body#' $step
    done
    
    
  • Justin Smestad

    Justin Smestad January 24th, 2009 @ 07:38 PM

    That seemed to solve the problem with response.body.should have_xpath..., but now I need the updated command to do:

    response.should_not be_successful

    Thanks for the help with this :D

  • Bryan Helmkamp

    Bryan Helmkamp January 25th, 2009 @ 04:52 PM

    • Milestone set to 0.4.1
  • Bryan Helmkamp

    Bryan Helmkamp January 26th, 2009 @ 09:49 AM

    • State changed from “new” to “open”

    Derek -- I think that code should be added to merb_cucumber. I've forked merb_cucumber and will be committing that (as well as some other tweaks for Webrat).

  • Bryan Helmkamp

    Bryan Helmkamp February 8th, 2009 @ 11:22 PM

    • Milestone changed from 0.4.1 to 0.4.2
  • gaffo

    gaffo June 3rd, 2009 @ 10:13 AM

    • Tag changed from integration, merb, merb_cucumber, response, rspec to integration, merb, merb_cucumber, response, rspec, stale

    Derek,
    Is this still an issue?

    Thanks

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Ruby Acceptance Testing for Web applications.

Shared Ticket Bins

Pages