Showing 661 of 695 total issues
Use let
instead of an instance variable. Open
Open
expect(@mail).to be_truthy
- Create a ticketCreate a ticket
- Exclude checks
Use let
instead of an instance variable. Open
Open
@email_card.update! content: "QuIrE@example.com"
- Create a ticketCreate a ticket
- Exclude checks
Start context description with 'when', 'with', or 'without'. Open
Open
context "invitation" do
- Create a ticketCreate a ticket
- Exclude checks
Use let
instead of an instance variable. Open
Open
expect(@read_rules).to be_member(Card.fetch("*all+*read").id)
- Create a ticketCreate a ticket
- Exclude checks
Use let
instead of an instance variable. Open
Open
expect(ids.length).to eq(@read_rules.size + 11)
- Create a ticketCreate a ticket
- Exclude checks
Start context description with 'when', 'with', or 'without'. Open
Open
context "+*account+*email" do
- Create a ticketCreate a ticket
- Exclude checks
Use let
instead of an instance variable. Open
Open
expect(@format.render_raw).to eq("u1@user.com")
- Create a ticketCreate a ticket
- Exclude checks
Use let
instead of an instance variable. Open
Open
expect(@email_card.errors[:content].first).to match(/must be unique/)
- Create a ticketCreate a ticket
- Exclude checks
Use match?
instead of =~
when MatchData
is not used. Open
Open
next if part =~ /^_/ # this removes relative parts. why?
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
In Ruby 2.4, String#match?
, Regexp#match?
and Symbol#match?
have been added. The methods are faster than match
.
Because the methods avoid creating a MatchData
object or saving
backref.
So, when MatchData
is not used, use match?
instead of match
.
Example:
# bad
def foo
if x =~ /re/
do_something
end
end
# bad
def foo
if x.match(/re/)
do_something
end
end
# bad
def foo
if /re/ === x
do_something
end
end
# good
def foo
if x.match?(/re/)
do_something
end
end
# good
def foo
if x =~ /re/
do_something(Regexp.last_match)
end
end
# good
def foo
if x.match(/re/)
do_something($~)
end
end
# good
def foo
if /re/ === x
do_something($~)
end
end
Start context description with 'when', 'with', or 'without'. Open
Open
context "do not stabilize" do
- Create a ticketCreate a ticket
- Exclude checks
Use let
instead of an instance variable. Open
Open
expect(body).to include(@signup.name)
- Create a ticketCreate a ticket
- Exclude checks
Use let
instead of an instance variable. Open
Open
@account = @signup.account
- Create a ticketCreate a ticket
- Exclude checks
Start context description with 'when', 'with', or 'without'. Open
Open
context "<User>+*email" do
- Create a ticketCreate a ticket
- Exclude checks
Use let
instead of an instance variable. Open
Open
expect(@mail.parts[0].body.raw_source).to include(msg)
- Create a ticketCreate a ticket
- Exclude checks
Use let
instead of an instance variable. Open
Open
expect(@signup.type_id).to eq(Card::SignupID)
- Create a ticketCreate a ticket
- Exclude checks
Use let
instead of an instance variable. Open
Open
expect(@signup.type_id).to eq(Card::SignupID)
- Create a ticketCreate a ticket
- Exclude checks
Use let
instead of an instance variable. Open
Open
expect(@account.salt).not_to eq("")
- Create a ticketCreate a ticket
- Exclude checks
Use let
instead of an instance variable. Open
Open
open_view = @card.format.render_open
- Create a ticketCreate a ticket
- Exclude checks
Use let
instead of an instance variable. Open
Open
raw_source = @mail.parts[0].body.raw_source
- Create a ticketCreate a ticket
- Exclude checks
Missing top-level class documentation comment. Open
Open
class Object
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks for missing top-level documentation of classes and modules. Classes with no body are exempt from the check and so are namespace modules - modules that have nothing in their bodies except classes, other modules, or constant definitions.
The documentation requirement is annulled if the class or module has a "#:nodoc:" comment next to it. Likewise, "#:nodoc: all" does the same for all its children.
Example:
# bad
class Person
# ...
end
# good
# Description/Explanation of Person class
class Person
# ...
end