Skip to content

Instantly share code, notes, and snippets.

@jkyamog
Created January 29, 2013 04:12
Show Gist options
  • Save jkyamog/4661729 to your computer and use it in GitHub Desktop.
Save jkyamog/4661729 to your computer and use it in GitHub Desktop.
"Document Controller" should {
"create a document" in new WithApplication(FakeApplication(additionalConfiguration = additionalConfig)) {
val json = Json.obj("title" -> "Hello Bob",
"description" -> "description")
val result = DocumentController.createDocument(FakeRequest("POST", "/documents", FakeHeaders(), json))
status(result) must equalTo(OK)
}
"list documents" in new WithApplication(FakeApplication(additionalConfiguration = additionalConfig)) {
val docs = DocumentController.listDocuments (FakeRequest())
status(docs) must equalTo(OK)
contentAsString(docs) must contain("Hello Bob")
}
}
@jkyamog
Copy link
Author

jkyamog commented Jan 29, 2013

problem stack trace

[error] ! list documents
[error] TimeoutException: Futures timed out after 10000 milliseconds
[error] play.api.libs.concurrent.PlayPromise.await(Promise.scala:134)
[error] play.api.libs.concurrent.PlayPromise.await(Promise.scala:126)
[error] play.api.test.Helpers$.status(Helpers.scala:136)
[error] controllers.DocumentControllerTest$$anonfun$3$$anonfun$apply$4$$anon$2$$anonfun$2.apply$mcI$sp(DocumentControllerTest.scala:35)
[error] controllers.DocumentControllerTest$$anonfun$3$$anonfun$apply$4$$anon$2$$anonfun$2.apply(DocumentControllerTest.scala:35)
[error] controllers.DocumentControllerTest$$anonfun$3$$anonfun$apply$4$$anon$2$$anonfun$2.apply(DocumentControllerTest.scala:35)
[error] controllers.DocumentControllerTest$$anonfun$3$$anonfun$apply$4$$anon$2$delayedInit$body.apply(DocumentControllerTest.scala:35)
[error] play.api.test.WithApplication$$anonfun$around$1.apply(Specs.scala:20)
[error] play.api.test.WithApplication$$anonfun$around$1.apply(Specs.scala:20)
[error] play.api.test.Helpers$.running(Helpers.scala:40)
[error] play.api.test.WithApplication.around(Specs.scala:20)
[error] play.api.test.WithApplication.delayedInit(Specs.scala:17)
[error] controllers.DocumentControllerTest$$anonfun$3$$anonfun$apply$4$$anon$2.(DocumentControllerTest.scala:32)
[error] controllers.DocumentControllerTest$$anonfun$3$$anonfun$apply$4.apply(DocumentControllerTest.scala:32)
[error] controllers.DocumentControllerTest$$anonfun$3$$anonfun$apply$4.apply(DocumentControllerTest.scala:32)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment