Commit e3520891 authored by Szabolcs Gyurko's avatar Szabolcs Gyurko
Browse files

Changed the default test to be a little bit more meaningful

parent fc1a6eea
Pipeline #367 passed with stage
in 1 minute and 40 seconds
import org.junit.runner._
import org.specs2.mutable._
import org.specs2.runner._
import org.junit.runner._
import play.api.test._
import play.api.test.Helpers._
import play.api.test._
/**
* Add your spec here.
......@@ -15,16 +14,17 @@ class ApplicationSpec extends Specification {
"Application" should {
"send 404 on a bad request" in new WithApplication{
route(FakeRequest(GET, "/boum")) must beNone
"send 404 on a bad request" in new WithApplication {
val err404 = route(app, FakeRequest(GET, "/boum")).get
status(err404) must equalTo(NOT_FOUND)
}
"render the index page" in new WithApplication{
val home = route(FakeRequest(GET, "/")).get
"render the index page" in new WithApplication {
val home = route(app, FakeRequest(GET, "/")).get
status(home) must equalTo(OK)
contentType(home) must beSome.which(_ == "text/html")
contentAsString(home) must contain ("Your new application is ready.")
status(home) must equalTo(SEE_OTHER)
header("Location", home).get must contain("/queue")
}
}
}
......@@ -18,7 +18,7 @@ class IntegrationSpec extends Specification {
browser.goTo("http://localhost:" + port)
browser.pageSource must contain("Your new application is ready.")
browser.pageSource must contain("Queue")
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment