FarmBot/OpenFarm

View on GitHub
spec/policies/garden_policy_spec.rb

Summary

Maintainability
A
0 mins
Test Coverage

Block has too many lines. [73/25]
Open

describe GardenPolicy do
  subject { GardenPolicy }

  let (:current_user) { FactoryBot.create :user }
  let (:public_garden) { FactoryBot.create :garden }
Severity: Minor
Found in spec/policies/garden_policy_spec.rb by rubocop

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.

Block has too many lines. [50/25]
Open

  context 'for a user' do
    it 'should only return gardens in scope that are public' do
      Garden.collection.drop
      other_user = FactoryBot.create :user
      not_mine = FactoryBot.create :garden,
Severity: Minor
Found in spec/policies/garden_policy_spec.rb by rubocop

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.

(...) interpreted as grouped expression.
Open

  let (:admin) { FactoryBot.create :user, admin: true }
Severity: Minor
Found in spec/policies/garden_policy_spec.rb by rubocop

Checks for space between the name of a called method and a left parenthesis.

Example:

# bad
do_something (foo)

# good
do_something(foo)
do_something (2 + 3) * 4
do_something (foo * bar).baz

Align the arguments of a method call if they span more than one line.
Open

                                  is_private: false,
                                  name: 'yes!',
                                  user: other_user
Severity: Minor
Found in spec/policies/garden_policy_spec.rb by rubocop

Here we check if the arguments on a multi-line method definition are aligned.

Example: EnforcedStyle: withfirstargument (default)

# good

foo :bar,
    :baz

foo(
  :bar,
  :baz
)

# bad

foo :bar,
  :baz

foo(
  :bar,
    :baz
)

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

(...) interpreted as grouped expression.
Open

  let (:public_garden) { FactoryBot.create :garden }
Severity: Minor
Found in spec/policies/garden_policy_spec.rb by rubocop

Checks for space between the name of a called method and a left parenthesis.

Example:

# bad
do_something (foo)

# good
do_something(foo)
do_something (2 + 3) * 4
do_something (foo * bar).baz

Align the arguments of a method call if they span more than one line.
Open

                                is_private: true,
                                name: 'mine',
                                user: current_user
Severity: Minor
Found in spec/policies/garden_policy_spec.rb by rubocop

Here we check if the arguments on a multi-line method definition are aligned.

Example: EnforcedStyle: withfirstargument (default)

# good

foo :bar,
    :baz

foo(
  :bar,
  :baz
)

# bad

foo :bar,
  :baz

foo(
  :bar,
    :baz
)

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Align the arguments of a method call if they span more than one line.
Open

                             is_private: true,
                             name: 'nono',
                             user: current_user
Severity: Minor
Found in spec/policies/garden_policy_spec.rb by rubocop

Here we check if the arguments on a multi-line method definition are aligned.

Example: EnforcedStyle: withfirstargument (default)

# good

foo :bar,
    :baz

foo(
  :bar,
  :baz
)

# bad

foo :bar,
  :baz

foo(
  :bar,
    :baz
)

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Align the arguments of a method call if they span more than one line.
Open

                                            is_private: false,
                                            name: 'not mine but OK (public)',
                                            user: other_user
Severity: Minor
Found in spec/policies/garden_policy_spec.rb by rubocop

Here we check if the arguments on a multi-line method definition are aligned.

Example: EnforcedStyle: withfirstargument (default)

# good

foo :bar,
    :baz

foo(
  :bar,
  :baz
)

# bad

foo :bar,
  :baz

foo(
  :bar,
    :baz
)

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Missing frozen string literal comment.
Open

require 'spec_helper'
Severity: Minor
Found in spec/policies/garden_policy_spec.rb by rubocop

This cop is designed to help you transition from mutable string literals to frozen string literals. It will add the comment # frozen_string_literal: true to the top of files to enable frozen string literals. Frozen string literals may be default in future Ruby. The comment will be added below a shebang and encoding comment.

Note that the cop will ignore files where the comment exists but is set to false instead of true.

Example: EnforcedStyle: always (default)

# The `always` style will always add the frozen string literal comment
# to a file, regardless of the Ruby version or if `freeze` or `<<` are
# called on a string literal.
# bad
module Bar
  # ...
end

# good
# frozen_string_literal: true

module Bar
  # ...
end

# good
# frozen_string_literal: false

module Bar
  # ...
end

Example: EnforcedStyle: never

# The `never` will enforce that the frozen string literal comment does
# not exist in a file.
# bad
# frozen_string_literal: true

module Baz
  # ...
end

# good
module Baz
  # ...
end

Example: EnforcedStyle: always_true

# The `always_true` style enforces that the frozen string literal
# comment is set to `true`. This is a stricter option than `always`
# and forces projects to use frozen string literals.
# bad
# frozen_string_literal: false

module Baz
  # ...
end

# bad
module Baz
  # ...
end

# good
# frozen_string_literal: true

module Bar
  # ...
end

(...) interpreted as grouped expression.
Open

  let (:private_garden) { FactoryBot.create :garden, is_private: true }
Severity: Minor
Found in spec/policies/garden_policy_spec.rb by rubocop

Checks for space between the name of a called method and a left parenthesis.

Example:

# bad
do_something (foo)

# good
do_something(foo)
do_something (2 + 3) * 4
do_something (foo * bar).baz

(...) interpreted as grouped expression.
Open

  let (:current_user) { FactoryBot.create :user }
Severity: Minor
Found in spec/policies/garden_policy_spec.rb by rubocop

Checks for space between the name of a called method and a left parenthesis.

Example:

# bad
do_something (foo)

# good
do_something(foo)
do_something (2 + 3) * 4
do_something (foo * bar).baz

Align the arguments of a method call if they span more than one line.
Open

                                    is_private: true,
                                    name: 'not_mine',
                                    user: other_user
Severity: Minor
Found in spec/policies/garden_policy_spec.rb by rubocop

Here we check if the arguments on a multi-line method definition are aligned.

Example: EnforcedStyle: withfirstargument (default)

# good

foo :bar,
    :baz

foo(
  :bar,
  :baz
)

# bad

foo :bar,
  :baz

foo(
  :bar,
    :baz
)

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Align the arguments of a method call if they span more than one line.
Open

                             is_private: false,
                             name: 'yes!',
                             user: current_user
Severity: Minor
Found in spec/policies/garden_policy_spec.rb by rubocop

Here we check if the arguments on a multi-line method definition are aligned.

Example: EnforcedStyle: withfirstargument (default)

# good

foo :bar,
    :baz

foo(
  :bar,
  :baz
)

# bad

foo :bar,
  :baz

foo(
  :bar,
    :baz
)

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Align the arguments of a method call if they span more than one line.
Open

                                    is_private: true,
                                    name: 'not mine',
                                    user: other_user
Severity: Minor
Found in spec/policies/garden_policy_spec.rb by rubocop

Here we check if the arguments on a multi-line method definition are aligned.

Example: EnforcedStyle: withfirstargument (default)

# good

foo :bar,
    :baz

foo(
  :bar,
  :baz
)

# bad

foo :bar,
  :baz

foo(
  :bar,
    :baz
)

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

There are no issues that match your filters.

Category
Status