Cache is disabled for json responses.

This commit is contained in:
Keivan Beigi 2013-07-25 14:57:11 -07:00
commit 642207c68d
5 changed files with 40 additions and 8 deletions

View file

@ -5,6 +5,7 @@ using NLog;
using NzbDrone.Api.REST;
using NzbDrone.Common.Serializer;
using RestSharp;
using System.Linq;
namespace NzbDrone.Integration.Test.Client
{
@ -99,6 +100,8 @@ namespace NzbDrone.Integration.Test.Client
throw response.ErrorException;
}
AssertDisableCache(response.Headers);
response.ErrorMessage.Should().BeBlank();
response.StatusCode.Should().Be(statusCode);
@ -106,5 +109,13 @@ namespace NzbDrone.Integration.Test.Client
return Json.Deserialize<T>(response.Content);
}
private static void AssertDisableCache(IList<Parameter> headers)
{
headers.Single(c => c.Name == "Cache-Control").Value.Should().Be("no-cache, no-store, must-revalidate");
headers.Single(c => c.Name == "Pragma").Value.Should().Be("no-cache");
headers.Single(c => c.Name == "Expires").Value.Should().Be("0");
}
}
}