Class: ExampleAppShowcaseLocalesAssociationsTest

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

Overview

HABTM helpers on FormElementShowcase:

check_list  (locales)          -- editable multi-select
info_list   (locales_display)  -- read-only mirror of the same association
                                  via `alias_method :locales_display, :locales`

Locale (not Role) is the showcase association because Role is reserved for the auth Member/User model in this example app; reusing it on FormElementShowcase would coincidentally share rows with roles_users which is confusing.

Instance Method Summary collapse

Instance Method Details

#field_frame(attr) ⇒ Object



24
25
26
# File 'lib/installer_templates/example_app_tests/test/integration/example_app_showcase_locales_associations_test.rb', line 24

def field_frame(attr)
  "form_element_showcase_#{@showcase.id}_#{attr}"
end

#field_headers(attr) ⇒ Object



28
29
30
# File 'lib/installer_templates/example_app_tests/test/integration/example_app_showcase_locales_associations_test.rb', line 28

def field_headers(attr)
  { "Turbo-Frame" => field_frame(attr), "Accept" => "text/html" }
end