Skip to content

Commit

Permalink
Remove bad negative example from capybara sheet
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 committed Mar 7, 2022
1 parent c84d4c1 commit 0c462f0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions capybara.md
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 0c462f0

Please sign in to comment.