Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged |
---|---|---|---|---|
Pending |
Yes |
Yes |
2.4 |
- |
Checks that tests use RSpec before
hook over Rails setup
method.
# bad
setup do
allow(foo).to receive(:bar)
end
# good
before do
allow(foo).to receive(:bar)
end
Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged |
---|---|---|---|---|
Enabled |
Yes |
Yes |
1.23 |
2.0 |
Enforces use of symbolic or numeric value to describe HTTP status.
# bad
it { is_expected.to have_http_status 200 }
it { is_expected.to have_http_status 404 }
# good
it { is_expected.to have_http_status :ok }
it { is_expected.to have_http_status :not_found }
it { is_expected.to have_http_status :success }
it { is_expected.to have_http_status :error }
# bad
it { is_expected.to have_http_status :ok }
it { is_expected.to have_http_status :not_found }
# good
it { is_expected.to have_http_status 200 }
it { is_expected.to have_http_status 404 }
it { is_expected.to have_http_status :success }
it { is_expected.to have_http_status :error }
Name | Default value | Configurable values |
---|---|---|
EnforcedStyle |
|
|