diff options
Diffstat (limited to 'test/ApplicationSpec.scala')
-rw-r--r-- | test/ApplicationSpec.scala | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/ApplicationSpec.scala b/test/ApplicationSpec.scala new file mode 100644 index 0000000..6e20bd5 --- /dev/null +++ b/test/ApplicationSpec.scala | |||
@@ -0,0 +1,30 @@ | |||
1 | import org.specs2.mutable._ | ||
2 | import org.specs2.runner._ | ||
3 | import org.junit.runner._ | ||
4 | |||
5 | import play.api.test._ | ||
6 | import play.api.test.Helpers._ | ||
7 | |||
8 | /** | ||
9 | * Add your spec here. | ||
10 | * You can mock out a whole application including requests, plugins etc. | ||
11 | * For more information, consult the wiki. | ||
12 | */ | ||
13 | @RunWith(classOf[JUnitRunner]) | ||
14 | class ApplicationSpec extends Specification { | ||
15 | |||
16 | "Application" should { | ||
17 | |||
18 | "send 404 on a bad request" in new WithApplication{ | ||
19 | route(FakeRequest(GET, "/boum")) must beNone | ||
20 | } | ||
21 | |||
22 | "render the index page" in new WithApplication{ | ||
23 | val home = route(FakeRequest(GET, "/")).get | ||
24 | |||
25 | status(home) must equalTo(OK) | ||
26 | contentType(home) must beSome.which(_ == "text/html") | ||
27 | contentAsString(home) must contain ("Your new application is ready.") | ||
28 | } | ||
29 | } | ||
30 | } | ||