Rails 7.1 
  added
  
    Show archive.org snapshot
  
 a new method Rails.env.local?. If you want to stub the Rails env correctly, use ActiveSupport::EnvironmentInquirer like this:
# check if the value of stubbed_env is valid
allow(Rails).to receive(:env).and_return(ActiveSupport::EnvironmentInquirer.new(stubbed_env.to_s))
Posted by Julian to makandra dev (2024-10-08 11:48)