Minitest system tests trying to use `app_db.solid_errors` table
Opened this issue · 2 comments
Hi, I added SolidError to my app, and when I run failing minitest system test, I get
Error:
EventsTest#test_showing_dialog_with_day_details:
ActiveRecord::StatementInvalid: Mysql2::Error: Table 'kucharka_test.solid_errors' doesn't exist
and not getting the real error message (in this case RecordNotFound
).
Maybe I miscofigured something, but I mostly followed the default instructions.
Thanks for help!
What I tried:
- removing gem from Gemfile helps
- removing configuration lines from
production
anddevelopment
doesn't
I haven't looked into this and haven't had time but I think it has to do with the test DB not being configured the same way as prod and development. The error is happening and solid_errors is expecting it to be. In test solid_errors likely needs to be disabled somehow.
I imagine later will be an option to be disabled in test environments. Meanwhile I added in my config/environments/test.rb
file the following:
Rails.application.configure do
# ...
config.solid_errors.connects_to = { database: { writing: :errors }
end
And inside the config/database.yml
file:
test:
primary:
<<: *default
database: data/test_data.sqlite3
errors:
<<: *default
database: data/test_errors.sqlite3
migrations_paths: db/errors_migrate
This is working for me.