File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed
spec/rubocop/cop/rspec_rails Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 22
33SimpleCov . start do
44 enable_coverage :branch
5- minimum_coverage line : 100 , branch : 98.41
5+ minimum_coverage line : 100 , branch : 100
66 add_filter '/spec/'
77 add_filter '/vendor/bundle/'
88end
Original file line number Diff line number Diff line change 8989
9090 expect_no_corrections
9191 end
92+
93+ it 'registers no offense when Rack is not loaded' do
94+ hide_const ( 'Rack' )
95+
96+ expect_no_offenses ( <<~RUBY )
97+ it { is_expected.to have_http_status(404) }
98+ RUBY
99+ end
92100 end
93101
94102 context 'when EnforcedStyle is `numeric`' do
163171 RUBY
164172 end
165173 end
174+
175+ it 'registers no offense when Rack is not loaded' do
176+ hide_const ( 'Rack' )
177+
178+ expect_no_offenses ( <<~RUBY )
179+ it { is_expected.to have_http_status(:not_found) }
180+ RUBY
181+ end
166182 end
167183
168184 context 'when EnforcedStyle is `be_status`' do
287303 RUBY
288304 end
289305 end
306+
307+ it 'registers no offense when Rack is not loaded' do
308+ hide_const ( 'Rack' )
309+
310+ expect_no_offenses ( <<~RUBY )
311+ it { is_expected.to have_http_status(:not_found) }
312+ RUBY
313+ end
290314 end
291315end
You can’t perform that action at this time.
0 commit comments