Make negative Capybara matchers faster

Capybara matchers are smart enough to have these two statements
functionally equivalent:

    expect(page).not_to have_xpath('a')
    expect(page).to have_no_xpath('a')

But this only works if `Capybara::RSpecMatchers` module is included.
It is included automatically for specs in `spec/features`, but not for
pages objects.

Adding it speeds up tests relying on expecting something `not_to` be
present.
This commit is contained in:
Christophe Bliard
2022-11-14 09:21:04 +01:00
parent 12e1b8048c
commit e85b47979a
+1
View File
@@ -29,6 +29,7 @@
module Pages
class Page
include Capybara::DSL
include Capybara::RSpecMatchers
include RSpec::Matchers
include OpenProject::StaticRouting::UrlHelpers