smalltalk
/
osmo-st-all
Archived
1
0
Fork 0
This commit is contained in:
Nicolas Petton 2009-08-21 23:00:33 +00:00
parent 2bbd25b3f5
commit 746cc057b2
1 changed files with 8 additions and 8 deletions

View File

@ -2,7 +2,7 @@ TestCase subclass: RequestHandlerTest [
| requestHandler response | | requestHandler response |
<comment: nil> <comment: nil>
<category: 'Iliad-Tests-RequestHandlers'> <category: 'Iliad-Tests-Unit-RequestHandlers'>
setUp [ setUp [
requestHandler := RequestHandler new. requestHandler := RequestHandler new.
@ -14,25 +14,25 @@ TestCase subclass: RequestHandlerTest [
methods := 'OPTIONS,GET,HEAD,POST,DELETE,TRACE,PROPFIND,PROPPATCH,MKCOL,PUT,COPY,MOVE,LOCK,UNLOCK'. methods := 'OPTIONS,GET,HEAD,POST,DELETE,TRACE,PROPFIND,PROPPATCH,MKCOL,PUT,COPY,MOVE,LOCK,UNLOCK'.
requestHandler addAllowHeaderTo: response. requestHandler addAllowHeaderTo: response.
headers := response headers. headers := response headers.
self assert: ((Dictionary newFrom: headers) at: 'Allow') = methods self assert: ((Dictionary from: headers) at: 'Allow') = methods
] ]
testAddCacheHeaderTo [ testAddCacheHeaderTo [
| timeStamp headers | | timeStamp headers |
timeStamp := Support rfc1123StringFor: (TimeStamp timeStamp := Support rfc1123StringFor: (DateTime
fromSeconds: TimeStamp now asSeconds + (24 * 3600)). fromSeconds: DateTime now asSeconds + (24 * 3600)).
requestHandler addCacheHeaderTo: response. requestHandler addCacheHeaderTo: response.
headers := response headers. headers := response headers.
self assert: ((Dictionary newFrom: headers) at: 'expires') = timeStamp self assert: ((Dictionary from: headers) at: 'expires') = timeStamp
] ]
testAddNoCacheHeaderTo [ testAddNoCacheHeaderTo [
| timeStamp headers | | timeStamp headers |
timeStamp := Support rfc1123StringFor: TimeStamp now. timeStamp := Support rfc1123StringFor: DateTime now.
requestHandler addNoCacheHeaderTo: response. requestHandler addNoCacheHeaderTo: response.
headers := response headers. headers := response headers.
self assert: ((Dictionary newFrom: headers) at: 'expires') = timeStamp. self assert: ((Dictionary from: headers) at: 'expires') = timeStamp.
self assert: ((Dictionary newFrom: headers) at: 'Cache-Control') self assert: ((Dictionary from: headers) at: 'Cache-Control')
= 'no-store, no-cache, must-revalidate' = 'no-store, no-cache, must-revalidate'
] ]
] ]