Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions style/ruby/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,21 @@ Enable non-default setting involved with *skipping gem inspection* in debugger m
assert response['message'].include?('must be a valid email') # on error: expect false to be truthy
```

- Use the negative variations of Capybara matchers if you are testing that an element or selector is not present.
Using the positive form of these matchers will always make Capybara wait

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this say "wait for" ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'for' is optional

the default matcher timeout time, and this includes using these with `assert_not`.

```ruby

# good

assert page.has_no_content?('Submit') # immediately executes if 'Submit' is not found

# bad

assert_not page.has_content?('Submit') # always waits the default Capybara timeout time

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"waits for" ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

```

### System Tests

##### Organization
Expand Down