This repository has been archived on 2019-05-14. You can view files and clone it, but cannot push or open issues or pull requests.
Typertext/test/Typertext/Http/HttpResponse.test.js

20 lines
806 B
JavaScript
Raw Normal View History

2014-03-03 20:47:49 +00:00
describe("Typertext.Http.HttpResponse", function () {
2014-03-03 20:41:40 +00:00
it("exists", function () {
2014-03-03 20:47:49 +00:00
expect(typeof Typertext.Http.HttpResponse).toEqual("function");
2014-03-03 20:41:40 +00:00
});
it("works according to the parent class", function () {
2014-03-03 20:47:49 +00:00
function hf(input) {
return "TestString" + input;
}
2014-03-03 20:41:40 +00:00
var inputString = "Test message",
inputCode = 239,
2014-03-03 20:47:49 +00:00
inputHttp = Typertext.Http.HttpResponseStatus.clientError,
testClass = new Typertext.Http.HttpResponse(inputHttp, hf, inputCode, inputString);
2014-03-03 20:41:40 +00:00
2014-03-03 20:47:49 +00:00
expect(testClass.GetContent()).toEqual(inputString);
expect(testClass.GetHeader("foo")).toEqual("TestStringfoo");
expect(testClass.GetHttpStatus()).toEqual(inputCode);
expect(testClass.GetStatus()).toEqual(inputHttp);
2014-03-03 20:41:40 +00:00
});
});