Commit Graph

58 Commits

Author SHA1 Message Date
0daf413b47 Prevent sole admin from deleting their account
Without this guard, the last admin in the system could delete their own
account, making the application unmanageable. This adds a model method
`User#sole_admin?`, a controller guard in `RegistrationsController#destroy`,
and disables the delete button in the profile edit view when the current
user is the only remaining admin.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-01 06:52:14 +00:00
80130fb7d1 Allow cascade delete Unit/Quantity
Closes #32
2026-02-22 17:50:43 +01:00
1ba7d29441 Update tests to match labeled form changes 2026-02-22 00:55:21 +01:00
5fff9adf4d Delete Units respecting foreign key constraint 2025-01-16 20:46:22 +01:00
d250119601 Fix tests after routing/locale changes 2025-01-03 15:04:27 +01:00
b9d979ad0c Fix tests 2024-12-30 00:19:16 +01:00
8552571526 Disable Unit destuction for base units with subunits
Closes #40
2024-12-28 23:57:47 +01:00
bd40727231 Focus forms properly on open and close
Closes #44
2024-12-28 15:16:37 +01:00
8f85432982 Silence empty tests 2024-12-22 01:33:39 +01:00
d726e92445 Allow opening multiple new/edit forms
Closes #30
2024-12-21 17:52:45 +01:00
f0dab7a5f9 Fix Units new/edit display on validation errors
Add test_new_and_edit_on_validation_error
Closes #41
2024-12-17 01:53:25 +01:00
f472526aa8 Change variable name 2024-12-17 00:14:34 +01: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
dcffa86e93 Rename add -> new in test descriptions 2024-12-12 00:53:23 +01:00
d5719b1e9d Fill multiplier field, confirm Add button disabled 2024-12-12 00:44:26 +01:00
3a25c1dbd0 Equally sample add unit/add subunit/edit links for test 2024-12-12 00:35:11 +01:00
bb4fbb3adc Refine "add and edit disallow opening multiple forms" test 2024-12-10 18:11:13 +01:00
dc92a333be Fix UnitsTest#test_add_unit 2024-12-10 01:18:27 +01:00
f3f0b9dc9e Fix UnitsiTest#test_index 2024-12-09 20:00:14 +01:00
40808639cc Update tests to new schema 2024-12-08 15:29:01 +01:00
ebae0334d9 Test refinements 2024-03-16 16:07:50 +01:00
3872acacc6 Fix flaky testing of emails on async actions 2024-03-16 16:06:16 +01:00
8b81ae2dc5 Test Unit form opening/closing 2024-02-13 01:04:27 +01:00
1227c54e0e Fix flashes display after grid introduction
Closes #5
2024-01-17 21:57:18 +01:00
651534134e Refine tests 2024-01-17 05:41:08 +01:00
7cfa3a0af0 Refine Unit tests 2024-01-17 04:25:32 +01:00
dec3af27bf Migrate Users views to grid layout + turbo_stream
Closes #7
2024-01-17 03:30:04 +01:00
93929f2c07 Change User#disguise/revert to GET 2024-01-15 01:07:45 +01:00
a4f113ad48 Downgrade importmap-rails to 1.2
v2.0.1 down not fire turbo:load event in test env, which causes tests to
fail.
Issue reported: https://github.com/rails/importmap-rails/issues/233
2024-01-12 19:30:09 +01:00
0801e8059c Close form on Esc key. Localize submit button. 2024-01-06 18:06:36 +01:00
d1bfabc105 Better string input randomization 2024-01-06 01:05:28 +01:00
5c70736a91 Reword comments/descriptions 2024-01-05 21:56:57 +01:00
98c8fb9346 Validate Unit string lengths 2024-01-05 21:32:59 +01:00
d28ef26dc5 Manage focus on form show/hide 2024-01-05 21:07:12 +01:00
32b8daf29d Add Unit system tests 2024-01-05 04:16:38 +01:00
5b6e986170 Test user status update 2023-05-21 17:33:13 +02:00
f76344c220 Add action confirmation dialog 2023-05-14 17:57:20 +02:00
e4f595a329 Fix translations and enable i18n testing 2023-05-14 16:37:53 +02:00
54d8bc6b55 Fix typo 2023-05-14 16:17:08 +02:00
5e09adeae7 Update tests to use buttons
Add disguise/revert tests
2023-05-14 15:57:12 +02:00
a7fce807c5 Add Users#show 2023-05-05 18:29:11 +02:00
74965c5c0e Only user can delete his profile 2023-05-03 16:48:47 +02:00
74db85f26a Remove exception checking from system tests 2023-05-02 03:14:55 +02:00
60b7c2a0bd Test "users index visible only for admin" 2023-04-25 01:02:56 +02:00
b781c7e072 Test "delete user" 2023-04-25 00:40:50 +02:00
30a3ecd6d0 Update and test resend confirmation form 2023-04-19 19:50:15 +02:00
7dabbd3036 Update and test password recovery forms 2023-04-19 19:29:12 +02:00
894c21f322 Move reset buttons to corresponding forms 2023-04-19 01:32:06 +02:00
2d95b11a34 Test registration e-mail 2023-04-19 00:31:52 +02:00