2021-11-06 20:44:26 +00:00
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Net;
|
2014-09-02 04:02:55 +00:00
|
|
|
|
using FluentAssertions;
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Integration.Test
|
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
2016-04-04 17:40:51 +00:00
|
|
|
|
public class IndexHtmlFixture : IntegrationTest
|
2014-09-02 04:02:55 +00:00
|
|
|
|
{
|
|
|
|
|
[Test]
|
|
|
|
|
public void should_get_index_html()
|
|
|
|
|
{
|
|
|
|
|
var text = new WebClient().DownloadString(RootUrl);
|
|
|
|
|
text.Should().NotBeNullOrWhiteSpace();
|
|
|
|
|
}
|
2021-11-06 20:44:26 +00:00
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void index_should_not_be_cached()
|
|
|
|
|
{
|
|
|
|
|
var client = new WebClient();
|
|
|
|
|
_ = client.DownloadString(RootUrl);
|
|
|
|
|
|
|
|
|
|
var headers = client.ResponseHeaders;
|
|
|
|
|
|
|
|
|
|
headers.Get("Cache-Control").Split(',').Select(x => x.Trim())
|
|
|
|
|
.Should().BeEquivalentTo("no-store, no-cache".Split(',').Select(x => x.Trim()));
|
|
|
|
|
headers.Get("Pragma").Should().Be("no-cache");
|
|
|
|
|
headers.Get("Expires").Should().Be("-1");
|
|
|
|
|
}
|
2014-09-02 04:02:55 +00:00
|
|
|
|
}
|
2021-07-30 04:47:53 +00:00
|
|
|
|
}
|