Hi,
I would like to propose a feature where the RAILS_ENV is set to test only when it is not set previously. Something like
```
task :prepare do
ENV['RACK_ENV'] = ENV['RAILS_ENV'] ||= 'test'
if Rails.configuration.generators.options[:rails][:orm] == :active_record
if Rake::Task.task_defined?("test:prepare")
Rake::Task["test:prepare"].invoke
end
end
end
```
Here is the reason.
I would like to set up an rspec system spec that tests the integration between Uppy, Aws, Shrine and my app.
There will be one or two such spec, but I think they could grow to about 5-6 for testing with the payment service, youtube and some other services to which I would like to make real requests.
It feels natural for me to create a new environment called 'integration_test', where we would test the actual request and response. Again, from the thousands of specs that we would be running these are some 5-10 specs. In a test env this services are mocked. In the 'integration_test' these service are not mocked. In the AWS, Shrine, Uppy case there are log of things (shrine plugins) that are initialized with config/initializers/shine.rb like the plugins. This makes it not possible to change the specific configuration for the spec as the before :each is loaded after the initializers.
I would like to suggest the change the code "ENV['RACK_ENV'] = ENV['RAILS_ENV'] ||= 'test'".
I was looking at the rspec rails code and the RAILS_ENV seems to be set but never used after that so there is no real need for setting it.
What do you think?
Looking forward to hearing from you.