Class: ExampleAppApartmentTopLevelNewTest

Inherits:
ExampleAppIntegrationTestCase show all
Defined in:
lib/installer_templates/example_app_tests/test/integration/example_app_apartment_top_level_new_test.rb

Overview

7.5.2: top-level Apartment new / cancel / create keep the legacy UJS (+remote: true+) contract. 7.5.1 emitted data-turbo-frame=“apartments_list” on the new”+ link, but the index page wraps the list in a plain <div id=“apartments_list”> (not a <turbo-frame>) – so:

  • cancel / create targeted a frame the page did not have, and Turbo logged “Content missing” and dropped the response;

  • the new”+ click itself either fell back to a full-page navigation or landed in that broken state.

Wrapping the top-level list in a real <turbo-frame> regresses layout (the frame collapses inside position: absolute #outer_container), so the fix keeps top-level behind UJS: link_to_new_record omits Turbo data attributes when no parent_class is provided, and new.js.erb / list.js.erb swap #apartments_list contents in place.