From 811998b8e88152b05fa0e4df358f6adb5930babe Mon Sep 17 00:00:00 2001 From: Benjamin Quorning Date: Tue, 5 Nov 2019 21:22:14 +0100 Subject: [PATCH] Change potentially offensive terminology I think the few places we use the term "whitelist", we really don't need to. Changing to use "allowed" etc. instead. RuboCop did similar changes in https://github.com/rubocop-hq/rubocop/pull/7469. --- lib/rubocop/cop/rspec_rails/http_status.rb | 8 ++++---- spec/rubocop/cop/rspec_rails/http_status_spec.rb | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/rubocop/cop/rspec_rails/http_status.rb b/lib/rubocop/cop/rspec_rails/http_status.rb index 9941df49..fae03385 100644 --- a/lib/rubocop/cop/rspec_rails/http_status.rb +++ b/lib/rubocop/cop/rspec_rails/http_status.rb @@ -107,7 +107,7 @@ class NumericStyleChecker MSG = 'Prefer `%s` over `%s` ' \ 'to describe HTTP status code.' - WHITELIST_STATUS = %i[error success missing redirect].freeze + ALLOWED_STATUSES = %i[error success missing redirect].freeze attr_reader :node def initialize(node) @@ -115,7 +115,7 @@ def initialize(node) end def offensive? - !node.int_type? && !whitelisted_symbol? + !node.int_type? && !allowed_symbol? end def message @@ -136,8 +136,8 @@ def symbol node.value end - def whitelisted_symbol? - node.sym_type? && WHITELIST_STATUS.include?(node.value) + def allowed_symbol? + node.sym_type? && ALLOWED_STATUSES.include?(node.value) end end end diff --git a/spec/rubocop/cop/rspec_rails/http_status_spec.rb b/spec/rubocop/cop/rspec_rails/http_status_spec.rb index 2ce038ff..410a69c8 100644 --- a/spec/rubocop/cop/rspec_rails/http_status_spec.rb +++ b/spec/rubocop/cop/rspec_rails/http_status_spec.rb @@ -60,7 +60,7 @@ RUBY end - it 'does not register an offense when using whitelisted symbols' do + it 'does not register an offense when using allowed symbols' do expect_no_offenses(<<-RUBY) it { is_expected.to have_http_status :error } it { is_expected.to have_http_status :success }