-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from ba-st/48-Fail-to-load-Stargate-v2---Test-…
…Group- Changed test case to not depend on unit test of Hyperspace.
- Loading branch information
Showing
2 changed files
with
33 additions
and
16 deletions.
There are no files selected for viewing
16 changes: 0 additions & 16 deletions
16
source/Stargate-Model-Tests/HTTPNotAcceptableTest.extension.st
This file was deleted.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
source/Stargate-Model-Tests/HyperspaceExtensionsTest.class.st
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
Class { | ||
#name : #HyperspaceExtensionsTest, | ||
#superclass : #TestCase, | ||
#category : #'Stargate-Model-Tests-Extensions' | ||
} | ||
|
||
{ #category : #tests } | ||
HyperspaceExtensionsTest >> testBadRequestAsJSON [ | ||
|
||
| error json | | ||
|
||
error := HTTPClientError badRequest messageText: 'Ouch!'. | ||
json := NeoJSONObject fromString: ( NeoJSONWriter toStringPretty: error ). | ||
|
||
self | ||
assert: json message equals: 'Ouch!'; | ||
assert: json code equals: 400 | ||
] | ||
|
||
{ #category : #tests } | ||
HyperspaceExtensionsTest >> testNotAcceptableAsJSON [ | ||
|
||
| error json | | ||
|
||
error := HTTPNotAcceptable messageText: 'Ouch!' accepting: {'application/xml' asMediaType}. | ||
json := NeoJSONObject fromString: ( NeoJSONWriter toStringPretty: error ). | ||
|
||
self | ||
assert: json message equals: 'Ouch!'; | ||
assert: json code equals: 406; | ||
assert: json allowedMediaTypes size equals: 1; | ||
assert: json allowedMediaTypes first equals: 'application/xml' | ||
] |