Skip to content

Commit 6fbe387

Browse files
committed
Introduced integration test for new includeStaticFiles parameter
Confirm that by setting the `includeStaticFiles` argument in `MapTopicErrors()` (b591bd7) for the integration tests host (74b7cc8), we are effectively disabling `includeStaticFiles` in the corresponding `ErrorController.Http()` action (83f4691). As part of this, I needed to remove the (otherwise extraneous) check for the correct content type, since the custom error for static files will be of type `text/plain` instead of `text/html`. This validates the functionality called for in Feature #101.
1 parent 74b7cc8 commit 6fbe387

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

OnTopic.AspNetCore.Mvc.IntegrationTests/ServiceCollectionExtensionsTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ public async Task MapTopicSitemap_RespondsToRequest() {
9696
[InlineData("/MissingPage/", HttpStatusCode.NotFound, "400")]
9797
[InlineData("/Web/MissingPage/", HttpStatusCode.NotFound, "400")]
9898
[InlineData("/Web/Container/", HttpStatusCode.Forbidden, "400")]
99+
[InlineData("/Scripts/ECMAScript.js", HttpStatusCode.NotFound, "The resource requested could not found.")]
99100
public async Task UseStatusCodePages_ReturnsExpectedStatusCode(string path, HttpStatusCode statusCode, string expectedContent) {
100101

101102
var client = _factory.CreateClient();
@@ -104,7 +105,6 @@ public async Task UseStatusCodePages_ReturnsExpectedStatusCode(string path, Http
104105
var actualContent = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
105106

106107
Assert.Equal(statusCode, response.StatusCode);
107-
Assert.Equal("text/html; charset=utf-8", response.Content.Headers.ContentType?.ToString());
108108
Assert.Equal(expectedContent, actualContent);
109109

110110
}

0 commit comments

Comments
 (0)