From db559f88983e45ff46b089e3ec5c309ee94bd91b Mon Sep 17 00:00:00 2001 From: Allison Browne Date: Mon, 13 Mar 2023 23:09:31 -0400 Subject: [PATCH] Remove bad negative example from capybara sheet (#1798) Removes the bad negative example and adds a new one that still has bad performance. It use to be that `not_to` would wait in a non-performant way: https://www.cloudbees.com/blog/faster-rails-tests but now it it no longer waits: https://github.com/rubocop/rubocop-rspec/issues/378#issuecomment-463250177 --- capybara.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/capybara.md b/capybara.md index 8dd49736c..04b0737b3 100644 --- a/capybara.md +++ b/capybara.md @@ -122,11 +122,11 @@ In RSpec, you can use `page.should` assertions. expect(page).to have_no_button('Save') # OK ``` ```ruby -expect(page).not_to have_button('Save') # Bad +expect(page).not_to have_button('Save') # OK +``` +```ruby +!expect(page).to have_button('Save') # Bad ``` - -Use `should have_no_*` versions with RSpec matchers because -`should_not have_*` doesn't wait for a timeout from the driver. ## RSpec