Commit Graph

12 Commits

Author SHA1 Message Date
8213ccd9d3 Fix controller tests and SQLite compatibility for defaults_diff
Test infrastructure:
- Allow www.example.com host in test env (ActionDispatch::HostAuthorization
  was blocking all integration test requests)
- Include Devise::Test::IntegrationHelpers in ActionDispatch::IntegrationTest
  so tests can sign in with sign_in(user)

Controller tests:
- Rewrite UsersControllerTest to match actual routes/actions (no new/create/
  edit/destroy); sign in as admin; test update-self rejection via turbo_stream
- Fix Default::UnitsControllerTest to sign in before requesting the index

SQLite compatibility in Unit#defaults_diff:
- Hoist the inner "units" CTE to the outer WITH RECURSIVE level (fixes nested
  WITH syntax error) — this was the existing TODO in the code
- Use Unit.joins(...) for the recursive part instead of a raw Arel::SelectManager
  so the SQLite visitor does not wrap it in parentheses inside UNION ALL
- Drop the named "units" CTE (conflicts with the table name under WITH RECURSIVE
  in SQLite); apply the user/defaults scope directly on the base case
- Qualify GROUP BY columns to avoid ambiguity when bases_units is joined
- Qualify ORDER BY :multiplier/:symbol to avoid ambiguity (Unit.ordering)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-01 04:57:36 +00:00
e15b983b56 Avoid duplicated symbols, check created record attributes 2024-12-15 23:36:24 +01:00
30ee4a861e Define LINK_LABELS once. Generate Unicode random strings. 2024-12-14 19:40:01 +01:00
d5719b1e9d Fill multiplier field, confirm Add button disabled 2024-12-12 00:44:26 +01:00
bb4fbb3adc Refine "add and edit disallow opening multiple forms" test 2024-12-10 18:11:13 +01:00
d1bfabc105 Better string input randomization 2024-01-06 01:05:28 +01:00
32b8daf29d Add Unit system tests 2024-01-05 04:16:38 +01:00
2d95b11a34 Test registration e-mail 2023-04-19 00:31:52 +02:00
5615113b9f Test "register" 2023-04-14 01:09:18 +02:00
cc857a74bf Randomize sign-in tests 2023-04-14 00:28:49 +02:00
3f2a92a6e5 Test "sign in" 2023-04-12 23:23:37 +02:00
6d2d12a9da rails new
THOR_MERGE=vimdiff bundle exec rails new -d mysql --skip-action-mailbox
  --skip-action-text --skip-active-job --skip-active-storage
  --skip-action-cable --skip-hotwire --skip-jbuilder --skip-bootsnap
  --skip-bundle .
2023-03-05 19:23:29 +01:00