Class: ExampleAppShowcaseMoneyUpdateTest
- Inherits:
-
ExampleAppIntegrationTestCase
- Object
- ActionDispatch::IntegrationTest
- ExampleAppIntegrationTestCase
- ExampleAppShowcaseMoneyUpdateTest
- Defined in:
- lib/installer_templates/example_app_tests/test/integration/example_app_showcase_money_update_test.rb
Overview
Regression for the inline attribute :update action.
The bug: update ignored the return value of @object.save and always
re-rendered field_show from the in-memory @object. money-rails rejects
an unparseable amount like "99.ace99" (the monetized validator fails, so
save returns false and amount_cents is never written), yet the user saw
a "saved" show of the unsaved in-memory value. Re-opening the edit revealed
the old value -- the success render was a lie.
The fix branches on @object.save: on failure it re-renders the EDIT field
(with the rejected raw input still visible) instead of a fake show.