diff --git a/spec/rubocop/cop/rails/unknown_env_spec.rb b/spec/rubocop/cop/rails/unknown_env_spec.rb index 6e9ae6de19..b4b7b36185 100644 --- a/spec/rubocop/cop/rails/unknown_env_spec.rb +++ b/spec/rubocop/cop/rails/unknown_env_spec.rb @@ -84,25 +84,8 @@ RUBY end - context 'Rails 7.1' do - let(:config) do - RuboCop::Config.new( - { - 'AllCops' => { - 'TargetRailsVersion' => '7.1' - }, - 'Rails/UnknownEnv' => { - 'Environments' => %w[ - development - production - test - ] - } - } - ) - end - - it 'accepts local as an environment name on Rails 7.1' do + context 'when Rails 7.1 or newer', :rails71 do + it 'accepts local as an environment name' do expect_no_offenses(<<~RUBY) Rails.env.local? Rails.env == 'local'