Deprecation warning from Capybara

前端 未结 5 580
一向
一向 2020-12-31 14:47

I am upgrading from rails 3.2.19 to rails 4.1.5, using rspec-rails 2.14.0.rc1 and capybara 2.4.1. All tests pass, and I only have one deprecation warning left:



        
5条回答
  •  太阳男子
    2020-12-31 15:11

    Given that the exception says:

    Please use Capybara::Session#accept_confirm instead.

    You probably want:

    page.accept_confirm
    

    Note that accept_confirm is being run against the Capybara::Session instead of the driver.

    This method expects a block that triggers the confirm alert to appear. For example:

    page.accept_confirm do
      click_link('that_opens_confirm')
    end
    

提交回复
热议问题