rstacruz / cheatsheets

Cheatsheets for web development - devhints.io
https://devhints.io
13.63k stars 3.58k forks source link

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

Closed ydah closed 3 months ago

ydah commented 3 months ago
!expect(page).to have_button('Save')

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:

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.

rstacruz commented 3 months ago

Good call, thanks for this!