ConradIrwin / pry-rescue

Start a pry session whenever something goes wrong.
MIT License
848 stars 49 forks source link

after capybara example is rescued page has been reset #102

Open catmando opened 8 years ago

catmando commented 8 years ago

Pry rescue is great.

However when using it with capybara + poltergeist once you hit the rescue you can't poke around, get a screen shot etc.

For example:

   # somewhere in my test
   page.should have_content('foobar')
   # if the above line fails, I can do (for example) page.save_screenshot

I have checked my after/before handlers, and as far as I can see I have all resets, etc turned off.

Anything else I can try?

PhilT commented 7 years ago

I see this as well. I think it's still running database clean up tasks so either the transaction completes or (in my case) it's truncating all the tables. I don't have a solution yet.

PhilT commented 7 years ago

Probably duplicate of #99

joallard commented 4 years ago

The way I'm able to confirm #99 is to notice that putting require 'pry-rescue/rspec' at the top of the file gives me empty database tables, but putting binding.pry right before the error doesn't trigger the bug. Maybe it applies in this case.

dkniffin commented 3 years ago

I was also experiencing this, but I don't think it was quite the same issue as others had. In my case, I was running rspec via I was running rspec viabundle exec rescue bin/rspec. The fix was to instead addrequire 'pry-rescue/rspec'to the top of myspec/rails_helper.rbfile, then run my specs normally usingbin/spec`