File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed
lib/rubocop/cop/rspec/rails Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -107,15 +107,15 @@ class NumericStyleChecker
107107 MSG = 'Prefer `%<prefer>s` over `%<current>s` ' \
108108 'to describe HTTP status code.'
109109
110- WHITELIST_STATUS = %i[ error success missing redirect ] . freeze
110+ ALLOWED_STATUSES = %i[ error success missing redirect ] . freeze
111111
112112 attr_reader :node
113113 def initialize ( node )
114114 @node = node
115115 end
116116
117117 def offensive?
118- !node . int_type? && !whitelisted_symbol ?
118+ !node . int_type? && !allowed_symbol ?
119119 end
120120
121121 def message
@@ -136,8 +136,8 @@ def symbol
136136 node . value
137137 end
138138
139- def whitelisted_symbol ?
140- node . sym_type? && WHITELIST_STATUS . include? ( node . value )
139+ def allowed_symbol ?
140+ node . sym_type? && ALLOWED_STATUSES . include? ( node . value )
141141 end
142142 end
143143 end
Original file line number Diff line number Diff line change 7676 context 'when configured' do
7777 let ( :cop_config ) { { 'Prefixes' => %w[ if ] } }
7878
79- it 'finds context without whitelisted prefixes at the beginning' do
79+ it 'finds context without allowed prefixes at the beginning' do
8080 expect_offense ( <<-RUBY )
8181 context 'when display name is present' do
8282 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Start context description with 'if'.
8383 end
8484 RUBY
8585 end
8686
87- it 'skips descriptions with whitelisted prefixes at the beginning' do
87+ it 'skips descriptions with allowed prefixes at the beginning' do
8888 expect_no_offenses ( <<-RUBY )
8989 context 'if display name is present' do
9090 end
Original file line number Diff line number Diff line change 6060 RUBY
6161 end
6262
63- it 'does not register an offense when using whitelisted symbols' do
63+ it 'does not register an offense when using allowed symbols' do
6464 expect_no_offenses ( <<-RUBY )
6565 it { is_expected.to have_http_status :error }
6666 it { is_expected.to have_http_status :success }
You can’t perform that action at this time.
0 commit comments