This commit is contained in:
parent
2bbd25b3f5
commit
746cc057b2
|
@ -2,7 +2,7 @@ TestCase subclass: RequestHandlerTest [
|
|||
| requestHandler response |
|
||||
|
||||
<comment: nil>
|
||||
<category: 'Iliad-Tests-RequestHandlers'>
|
||||
<category: 'Iliad-Tests-Unit-RequestHandlers'>
|
||||
|
||||
setUp [
|
||||
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'.
|
||||
requestHandler addAllowHeaderTo: response.
|
||||
headers := response headers.
|
||||
self assert: ((Dictionary newFrom: headers) at: 'Allow') = methods
|
||||
self assert: ((Dictionary from: headers) at: 'Allow') = methods
|
||||
]
|
||||
|
||||
testAddCacheHeaderTo [
|
||||
| timeStamp headers |
|
||||
timeStamp := Support rfc1123StringFor: (TimeStamp
|
||||
fromSeconds: TimeStamp now asSeconds + (24 * 3600)).
|
||||
timeStamp := Support rfc1123StringFor: (DateTime
|
||||
fromSeconds: DateTime now asSeconds + (24 * 3600)).
|
||||
requestHandler addCacheHeaderTo: response.
|
||||
headers := response headers.
|
||||
self assert: ((Dictionary newFrom: headers) at: 'expires') = timeStamp
|
||||
self assert: ((Dictionary from: headers) at: 'expires') = timeStamp
|
||||
]
|
||||
|
||||
testAddNoCacheHeaderTo [
|
||||
| timeStamp headers |
|
||||
timeStamp := Support rfc1123StringFor: TimeStamp now.
|
||||
timeStamp := Support rfc1123StringFor: DateTime now.
|
||||
requestHandler addNoCacheHeaderTo: response.
|
||||
headers := response headers.
|
||||
self assert: ((Dictionary newFrom: headers) at: 'expires') = timeStamp.
|
||||
self assert: ((Dictionary newFrom: headers) at: 'Cache-Control')
|
||||
self assert: ((Dictionary from: headers) at: 'expires') = timeStamp.
|
||||
self assert: ((Dictionary from: headers) at: 'Cache-Control')
|
||||
= 'no-store, no-cache, must-revalidate'
|
||||
]
|
||||
]
|
||||
|
|
Reference in New Issue