When invoking the app:test
task in an engine, the Rails environment is set to “development”. Is this the intended behaviour? It would be great if someone could shed some light on this, as it seems a bit confusing.
I can force the environment to “test” by prefixing the command with RAILS_ENV=test
, but should that be necessary?
Steps to reproduce
- Generate a new Rails engine:
rails plugin new blorgh --mountable
- Add the line
puts Rails.env
totest_helper.rb
- Run the task
rails test
. It will outputtest
. - Run the taks
rails app:test
. It will outputdevelopment
.
System configuration
- Rails version: 6.0.3.2
- Ruby version: 2.6.4p104