Remove instance variables in has_filters spec

This was a false positive in Rubocop, but we can avoid it by using the
attribute reader method we've just added.
This commit is contained in:
Javi Martín
2021-01-19 14:29:53 +01:00
committed by Senén Rodero Rodríguez
parent 739d23fe73
commit 21021f5054
2 changed files with 1 additions and 2 deletions

View File

@@ -360,7 +360,6 @@ RSpec/HookArgument:
RSpec/InstanceVariable:
Enabled: true
Exclude:
- spec/controllers/concerns/has_filters_spec.rb
- spec/controllers/concerns/has_orders_spec.rb
RSpec/LetBeforeExamples:

View File

@@ -6,7 +6,7 @@ describe HasFilters do
has_filters ["all", "pending", "reviewed"], only: :index
def index
render plain: "#{@current_filter} (#{@valid_filters.join(" ")})"
render plain: "#{current_filter} (#{valid_filters.join(" ")})"
end
end