@@ -58,7 +58,7 @@ public function index()
58
58
})::register ();
59
59
60
60
$ this ->withFakeViews ();
61
- $ this ->viewShouldReturnRaw ('layout ' , '<html><head></head>< body>{{ template_content }}</body></html> ' );
61
+ $ this ->viewShouldReturnRaw ('layout ' , '<html><body>{{ template_content }}</body></html> ' );
62
62
$ this ->viewShouldReturnRaw ('default ' , '{{ example_count }} {{ nocache }}{{ example_count }}{{ /nocache }} ' );
63
63
64
64
$ this ->createPage ('about ' );
@@ -75,14 +75,14 @@ public function index()
75
75
$ region = app (Session::class)->regions ()->first ();
76
76
77
77
// Initial response should be dynamic and not contain javascript.
78
- $ this ->assertEquals ('<html><head></head>< body>1 2</body></html> ' , $ response ->getContent ());
78
+ $ this ->assertEquals ('<html><body>1 2</body></html> ' , $ response ->getContent ());
79
79
80
80
// The cached response should have the nocache placeholder, and the javascript.
81
81
$ this ->assertTrue (file_exists ($ this ->dir .'/about_.html ' ));
82
- $ this ->assertEquals (vsprintf ('<html><head>%s</head><body>1 <span class="nocache" data-nocache="%s">%s</span></body></html> ' , [
83
- '<script type="text/javascript">js here</script> ' ,
82
+ $ this ->assertEquals (vsprintf ('<html><body>1 <span class="nocache" data-nocache="%s">%s</span>%s</body></html> ' , [
84
83
$ region ->key (),
85
84
'<svg>Loading...</svg> ' ,
85
+ '<script type="text/javascript">js here</script> ' ,
86
86
]), file_get_contents ($ this ->dir .'/about_.html ' ));
87
87
}
88
88
@@ -135,7 +135,7 @@ public function index()
135
135
public function it_should_add_the_javascript_if_there_is_a_csrf_token ()
136
136
{
137
137
$ this ->withFakeViews ();
138
- $ this ->viewShouldReturnRaw ('layout ' , '<html><head></head>< body>{{ template_content }}</body></html> ' );
138
+ $ this ->viewShouldReturnRaw ('layout ' , '<html><body>{{ template_content }}</body></html> ' );
139
139
$ this ->viewShouldReturnRaw ('default ' , '{{ csrf_token }} ' );
140
140
141
141
$ this ->createPage ('about ' );
@@ -149,11 +149,11 @@ public function it_should_add_the_javascript_if_there_is_a_csrf_token()
149
149
->assertOk ();
150
150
151
151
// Initial response should be dynamic and not contain javascript.
152
- $ this ->assertEquals ('<html><head></head>< body> ' .csrf_token ().'</body></html> ' , $ response ->getContent ());
152
+ $ this ->assertEquals ('<html><body> ' .csrf_token ().'</body></html> ' , $ response ->getContent ());
153
153
154
154
// The cached response should have the token placeholder, and the javascript.
155
155
$ this ->assertTrue (file_exists ($ this ->dir .'/about_.html ' ));
156
- $ this ->assertEquals (vsprintf ('<html><head>%s</head>< body>STATAMIC_CSRF_TOKEN</body></html> ' , [
156
+ $ this ->assertEquals (vsprintf ('<html><body>STATAMIC_CSRF_TOKEN%s </body></html> ' , [
157
157
'<script type="text/javascript">js here</script> ' ,
158
158
]), file_get_contents ($ this ->dir .'/about_.html ' ));
159
159
}
0 commit comments