Skip to content

Commit

Permalink
Remove bad negative example from capybara sheet (#1798)
Browse files Browse the repository at this point in the history
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: 
rubocop/rubocop-rspec#378 (comment)
  • Loading branch information
getschomp authored Mar 14, 2023
1 parent ea5f910 commit db559f8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions capybara.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit db559f8

Please sign in to comment.