@@ -63,15 +63,19 @@ class PlainReactOnRailsHelper
6363 original_append_javascript_pack_tag = helper . method ( :append_javascript_pack_tag )
6464 begin
6565 # Temporarily redefine append_javascript_pack_tag to handle the async keyword argument.
66- # This is needed because older versions of Shakapacker (which may be used during testing) don't support async loading,
67- # but we still want to test that the async option is passed correctly when enabled.
66+ # This is needed because older versions of Shakapacker (which may be used during testing)
67+ # don't support async loading, but we still want to test that the async option is passed
68+ # correctly when enabled.
6869 def helper . append_javascript_pack_tag ( name , **options )
6970 original_append_javascript_pack_tag . call ( name , **options )
7071 end
7172 allow ( helper ) . to receive ( :append_javascript_pack_tag )
7273 allow ( helper ) . to receive ( :append_stylesheet_pack_tag )
7374 expect { helper . load_pack_for_generated_component ( "component_name" , render_options ) } . not_to raise_error
74- expect ( helper ) . to have_received ( :append_javascript_pack_tag ) . with ( "generated/component_name" , { defer : false , async : true } )
75+ expect ( helper ) . to have_received ( :append_javascript_pack_tag ) . with (
76+ "generated/component_name" ,
77+ { defer : false , async : true }
78+ )
7579 expect ( helper ) . to have_received ( :append_stylesheet_pack_tag ) . with ( "generated/component_name" )
7680 ensure
7781 helper . define_singleton_method ( :append_javascript_pack_tag , original_append_javascript_pack_tag )
0 commit comments