spec/requests/smoke_test_spec.rb
Block has too many lines. [32/25] Open
Open
RSpec.describe "GET routes", type: :request do
before(:each) do
@annotation_document = FactoryGirl.create :annotation_document
@statistic = FactoryGirl.create :statistic
@raw_datum = @annotation_document.raw_datum
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
Open
RSpec.describe "GET routes", type: :request do
- Read upRead up
- Exclude checks
Checks if uses of quotes match the configured preference.
Example: EnforcedStyle: single_quotes (default)
# bad
"No special symbols"
"No string interpolation"
"Just text"
# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"
Example: EnforcedStyle: double_quotes
# bad
'Just some text'
'No special chars or interpolation'
# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"
%W
-literals should be delimited by [
and ]
. Open
Open
method = %W{ GET POST PUT PATCH DELETE }.grep(route.verb).first
- Read upRead up
- Exclude checks
This cop enforces the consistent usage of %
-literal delimiters.
Specify the 'default' key to set all preferred delimiters at once. You can continue to specify individual preferred delimiters to override the default.
Example:
# Style/PercentLiteralDelimiters:
# PreferredDelimiters:
# default: '[]'
# '%i': '()'
# good
%w[alpha beta] + %i(gamma delta)
# bad
%W(alpha #{beta})
# bad
%I(alpha beta)
Line is too long. [91/80] Open
Open
path = route.path.spec.to_s.gsub(/\(\.:format\)/, '').gsub(/:([a-zA-Z]+_){0,1}id/, '1')
- Exclude checks
Do not use %W
unless interpolation is needed. If not, use %w
. Open
Open
method = %W{ GET POST PUT PATCH DELETE }.grep(route.verb).first
- Read upRead up
- Exclude checks
This cop checks for usage of the %W() syntax when %w() would do.
Example:
# bad
%W(cat dog pig)
%W[door wall floor]
# good
%w/swim run bike/
%w[shirt pants shoes]
%W(apple #{fruit} grape)
Do not use spaces inside percent literal delimiters. Open
Open
method = %W{ GET POST PUT PATCH DELETE }.grep(route.verb).first
- Read upRead up
- Exclude checks
Checks for unnecessary additional spaces inside the delimiters of %i/%w/%x literals.
Example:
# good
%i(foo bar baz)
# bad
%w( foo bar baz )
# bad
%x( ls -l )
Do not use spaces inside percent literal delimiters. Open
Open
method = %W{ GET POST PUT PATCH DELETE }.grep(route.verb).first
- Read upRead up
- Exclude checks
Checks for unnecessary additional spaces inside the delimiters of %i/%w/%x literals.
Example:
# good
%i(foo bar baz)
# bad
%w( foo bar baz )
# bad
%x( ls -l )