Remove a case that is not negative examples in the capybara sheet (#2122)

The above case is a new Bad case added by https://github.com/rstacruz/cheatsheets/pull/1798 . It is designated as Bad due to performance issues, but it is not actually a Negative example. In practice, the following would be the same test:

```ruby
expect(page).to have_button('Save')
!expect(page).to have_button('Save')
```

This is not an example that will appear on the capybara cheat sheet, because it is a problem with how RSpec is written. I think it should be removed because it creates confusion.
This commit is contained in:
Yudai Takada 2024-03-22 06:53:55 +09:00 committed by GitHub
parent e8bfec363f
commit dc91d7f64e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 5 deletions

View File

@ -119,15 +119,15 @@ In RSpec, you can use `page.should` assertions.
### About negatives
```ruby
expect(page).to have_no_button('Save') # OK
expect(page).to have_no_button('Save')
```
```ruby
expect(page).not_to have_button('Save') # OK
```
```ruby
!expect(page).to have_button('Save') # Bad
expect(page).not_to have_button('Save')
```
The two above statements are functionally equivalent.
## RSpec
### Matchers