How to send delete request and inspect the Capybara::Session instead of the Rack::Response?

563 Views Asked by At

I'm testing with cucumber, capybara and rack-test.

I want to send a delete request and then inspect the response.

I've found that the method visit(url) store the response in the object page which is a Capybara::Session.

Now I'm sending the delete request with the method delete url and then follow_redirect!. The problem here is that these methods store the response in the object last_response which is a Rack::MockResponse.

My web steps are built using the page object but I can't find the way to send delete request and storing the response in page.

Any help?

1

There are 1 best solutions below

0
On

I think you can use the Capybara driver via:

page.driver.delete