I'm trying to do the same.
I think that for having rails test
to also run system tests you need to redefine the rake task. For what I could investigate the task is defined at testing.rake
file inside the railties gem /lib
directory:
desc "Runs all tests in test folder except system ones"
task :test do
$: << "test"
if ENV.key?("TEST")
Minitest.rake_run([ENV["TEST"]])
else
Minitest.rake_run(["test"], ["test/system/**/*"])
end
end
The second argument in the function inside else
is a pattern to exclude when running the tests.
Here Overriding rails' default rake tasks
it's explained how to override them, however I couldn't put it to work this way.
If it helps you, I'm using bundle exec rake test:system test
instead and it runs both the system and all the other tests together