@@ -53,8 +53,8 @@ def wait_to_ensure_asset_pipeline_detects_changes
5353 assert_no_match ( /console.error/ , response . body )
5454 end
5555
56- test 'react inline component rendering' do
57- get '/server/inline_component '
56+ test 'react inline component rendering (pre-rendered) ' do
57+ get '/server/inline_component_prerender_true '
5858 rendered_html = response . body
5959 assert_match ( /<span.*data-react-class=\" TodoList\" / , rendered_html )
6060 # make sure that the items are prerendered
@@ -67,5 +67,21 @@ def wait_to_ensure_asset_pipeline_detects_changes
6767 assert_match ( /id=\" custom-id\" / , rendered_html )
6868 assert_match ( /data-remote=\" true\" / , rendered_html )
6969 end
70+
71+ test 'react inline component rendering (not pre-rendered)' do
72+ get '/server/inline_component_prerender_false'
73+ rendered_html = response . body
74+
75+ assert_match ( /<span.*data-react-class=\" TodoList\" / , rendered_html )
76+ # make sure that the items are prerendered
77+ assert_match ( /Render this inline/ , rendered_html )
78+ assert_match ( /<\/ span>/ , rendered_html , "it accepts a tag override" )
79+ # make sure that the layout is rendered with the component
80+ assert_match ( /<title>Dummy<\/ title>/ , rendered_html )
81+ # make sure that custom html attributes are rendered
82+ assert_match ( /class=\" custom-class\" / , rendered_html )
83+ assert_match ( /id=\" custom-id\" / , rendered_html )
84+ assert_match ( /data-remote=\" true\" / , rendered_html )
85+ end
7086 end
7187end
0 commit comments