Workit
Workit/ActionArgs
Workit/ComitteeAssertSchemaConfirm
| Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed |
|---|---|---|---|---|
Disabled |
Yes |
Yes |
- |
- |
Check for not pass expected response status code to check it against the corresponding schema explicitly.
This cop is deprecated.
Workit/CommitteeExpectedResponseStatusCode
| Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed |
|---|---|---|---|---|
Disabled |
Yes |
Yes |
- |
- |
Check if the status code is specified as an argument to the method of the Committee where the expected response status code is required.
Workit/NoopRescue
| Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed |
|---|---|---|---|---|
Disabled |
Yes |
No |
- |
- |
Check for suppress or ignore checked exception.
Workit/RSpecCapybaraMatchStyle
| Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed |
|---|---|---|---|---|
Disabled |
Yes |
Yes |
- |
- |
Checks for usage of deprecated style methods.
Examples
when using assert_style
# bad
page.find(:css, '#first').assert_style(display: 'block')
# good
page.find(:css, '#first').assert_matches_style(display: 'block')
Workit/RSpecCapybaraPredicateMatcher
| Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed |
|---|---|---|---|---|
Disabled |
Yes |
Yes |
- |
- |
Prefer using predicate matcher over using predicate method directly.
Capybara defines magic matchers for predicate methods. This cop recommends to use the predicate matcher instead of using predicate method directly.
Examples
Strict: true, EnforcedStyle: inflected (default)
# bad
expect(foo.matches_css?(bar: 'baz')).to be_truthy
expect(foo.matches_selector?(bar: 'baz')).to be_truthy
expect(foo.matches_style?(bar: 'baz')).to be_truthy
expect(foo.matches_xpath?(bar: 'baz')).to be_truthy
# good
expect(foo).to match_css(bar: 'baz')
expect(foo).to match_selector(bar: 'baz')
expect(foo).to match_style(bar: 'baz')
expect(foo).to match_xpath(bar: 'baz')
# also good - It checks "true" strictly.
expect(foo.matches_style?(bar: 'baz')).to be(true)
Strict: false, EnforcedStyle: inflected
# bad
expect(foo.matches_style?(bar: 'baz')).to be_truthy
expect(foo.matches_style?(bar: 'baz')).to be(true)
# good
expect(foo).to match_style(bar: 'baz')
Workit/RSpecMinitestAssertions
| Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed |
|---|---|---|---|---|
Disabled |
Yes |
Yes |
- |
- |
Check if using Minitest matchers.
Workit/RSpecRedundantHttpStatus
| Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed |
|---|---|---|---|---|
Disabled |
Yes |
Yes |
- |
- |
Check for validation of redundant response HTTP status codes.