-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
41b5db1
commit 3cef3df
Showing
3 changed files
with
92 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,31 @@ | ||
var testResources = require('require-namespace').testResources; | ||
var resource = testResources.require('entryPointCreator'); | ||
var express = require('express'); | ||
var testUtil = require('./../testUtil'); | ||
|
||
describe("get cache forever - ", function() { | ||
describe('when you test a get request and resource returns json which can be cached for twenty years publically', function() { | ||
var testBuilder; | ||
|
||
beforeEach(function() { | ||
var app = express(); | ||
var resourceTest = require('../../../index'); | ||
var fixture = require('../../testFixture') | ||
var assert = fixture.assert; | ||
|
||
app.get('/cacheForever', function(req, res){ | ||
var twentyYears = 20 * 365 * 24 * 60 * 60; | ||
res.header('Cache-Control', 'public, max-age=' + twentyYears) | ||
res.send({ name: 'fido' }); | ||
}); | ||
var express = require('express'); | ||
var superAgent = require('superagent'); | ||
|
||
testBuilder = resource(app).get('/cacheForever'); | ||
}); | ||
var testUtil = require('./../testUtil'); | ||
var startServer = fixture.testResources.startServerFluent; | ||
|
||
it('should pass if your expectation matches', function(done) { | ||
testBuilder | ||
.expectCachedForever('public') | ||
.run(testUtil.assertNoError(done)); | ||
describe('when you test a get request and resource returns json which can be cached for twenty years publically', function () { | ||
var testBuilder; | ||
|
||
beforeEach(function () { | ||
var app = express(); | ||
|
||
app.get('/cacheForever', function (req, res) { | ||
var twentyYears = 20 * 365 * 24 * 60 * 60; | ||
res.header('Cache-Control', 'public, max-age=' + twentyYears) | ||
res.send({ name: 'fido' }); | ||
}); | ||
}) | ||
|
||
testBuilder = resource(app).get('/cacheForever'); | ||
}); | ||
|
||
it('should pass if your expectation matches', function (done) { | ||
testBuilder | ||
.expectCachedForever('public') | ||
.run(testUtil.assertNoError(done)); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters