While trying to run RSpec test in rails 6.1.0 with Stimulus.js, I run into an issue where the only output I get from the terminal
EPRECATION WARNING: Initialization autoloaded the constants ApplicationHelper, DashboardHelper, WelcomeHelper, FontAwesome5, FontAwesome5::Rails, FontAwesome5::Rails::IconHelper, Stimulus::StimulusHelper, DeviseHelper, ApplicationController, ActionText::ContentHelper, and ActionText::TagHelper.
Being able to do this is deprecated. Autoloading during initialization is going
to be an error condition in future versions of Rails.
Reloading does not reboot the application, and therefore code executed during
initialization does not run again. So, if you reload ApplicationHelper, for example,
the expected changes won't be reflected in that stale Module object.
These autoloaded constants have been unloaded.
In order to autoload safely at boot time, please wrap your code in a reloader
callback this way:
Rails.application.reloader.to_prepare do
# Autoload classes and modules needed at boot time here.
end
That block runs when the application boots, and every time there is a reload.
For historical reasons, it may run twice, so it has to be idempotent.
Check the "Autoloading and Reloading Constants" guide to learn more about how
Rails autoloads and reloads.
(called from <top (required)> at /Users/user/freelance/OneHR/config/environment.rb:5)
^C
RSpec is shutting down and will print the summary report... Interrupt again to force quit.
I have done some searching through different sites but haven't had any luck getting anything to run my tests.
I think that I have to add the code block with my Classes in my tests environment file but haven't had any luck with results yet. After this Error outputs to the console, RSpec hangs and I have to Command + C to exit. Not sure if I am missing something or if I messed up something.