Testing

Run commands from the LesliDashboard directory. Always use a dedicated test database. The suite covers CRUD, account boundaries, default replacement and deletion of the last dashboard, repeated registration, component validation and rollback, Turbo/JSON responses, forms, translations, and rendering through Core.

Standalone with Published Dependencies

bundle install
RAILS_ENV=test bundle exec rake -f test/dummy/Rakefile db:migrate
bundle exec rake test

Standalone with Workspace Dependencies

The development workspace must contain engines/Lesli, engines/LesliDashboard, and the gems listed in test/Gemfile.workspace. This manifest uses unreleased dependencies without loading other domain engines. Its lockfile is local and ignored. Use it while preparing a coordinated framework release; the regular Gemfile tests published dependencies instead.

export BUNDLE_GEMFILE="$PWD/test/Gemfile.workspace"
bundle install
export RAILS_ENV=test
export DATABASE_URL=sqlite3:/tmp/lesli_dashboard_test.sqlite3
bundle exec rake -f test/dummy/Rakefile db:migrate
bundle exec rake test

For PostgreSQL, create a dedicated database, change DATABASE_URL to its connection URL, and repeat migration and tests. The development Gemfiles include the pg adapter; it is not a runtime dependency of the engine.

export DATABASE_URL=postgresql://localhost/lesli_dashboard_test
bundle exec rake -f test/dummy/Rakefile db:migrate
bundle exec rake test

Concurrency tests use committed records and two synchronized connections. They are skipped on SQLite, whose locking differs from PostgreSQL. Tests involving LesliAdmin or LesliShield are skipped when those optional engines are absent; run the Builder integration checks to cover them.

Builder Integration

From the Builder root, using its own bundle and an isolated migrated database:

RAILS_ENV=test bundle exec bin/rails test engines/LesliDashboard/test test/integration/lesli_modules_test.rb engines/LesliAdmin/test/models/lesli_admin/dashboard_test.rb engines/LesliSupport/test/models/lesli_support/dashboard_test.rb

Run this command with both adapters. Core account creation must provision dashboards automatically, and two accounts must retain independent defaults, layouts, and widget configuration after registration is repeated.

 Edit this page

Last Update: 2026/11/13