import org.specs2.mutable._
import org.specs2.runner._
import org.junit.runner._

import play.api.test._
import play.api.test.Helpers._

/**
 * Add your spec here.
 * You can mock out a whole application including requests, plugins etc.
 * For more information, consult the wiki.

 Also see:
 http://stackoverflow.com/questions/31232782/play-run-tests-with-custom-guiceapplicationloader
 */
@RunWith(classOf[JUnitRunner])
class ApplicationSpec extends Specification {

  "Application" should {

    "send 404 on a bad request" in new WithApplicationLoader(new CustomApplicationLoader) {
      route(FakeRequest(GET, "/boum")) must beSome.which (status(_) == NOT_FOUND)
    }

    "render the index page" in new WithApplicationLoader(new CustomApplicationLoader) {
      val home = route(FakeRequest(GET, "/")).get

      status(home) must equalTo(SEE_OTHER)
      contentType(home) must beNone
    }
  }
}

import org.specs2.mutable._
import org.specs2.runner._
import org.junit.runner._

import play.api.test._
import play.api.test.Helpers._

/**
 * Add your spec here.
 * You can mock out a whole application including requests, plugins etc.
 * For more information, consult the wiki.

 Also see:
 http://stackoverflow.com/questions/31232782/play-run-tests-with-custom-guiceapplicationloader
 */
@RunWith(classOf[JUnitRunner])
class ApplicationSpec extends Specification {

  "Application" should {

    "send 404 on a bad request" in new WithApplicationLoader(new CustomApplicationLoader) {
      route(FakeRequest(GET, "/boum")) must beSome.which (status(_) == NOT_FOUND)
    }

    "render the index page" in new WithApplicationLoader(new CustomApplicationLoader) {
      val home = route(FakeRequest(GET, "/")).get

      status(home) must equalTo(OK)
      contentType(home) must beSome.which(_ == "text/html")
      //contentAsString(home) must contain ("Playing Now")
    }
  }
}

--- 
+++ 
@@ -25,9 +25,8 @@
     "render the index page" in new WithApplicationLoader(new CustomApplicationLoader) {
       val home = route(FakeRequest(GET, "/")).get
 
-      status(home) must equalTo(OK)
-      contentType(home) must beSome.which(_ == "text/html")
-      //contentAsString(home) must contain ("Playing Now")
+      status(home) must equalTo(SEE_OTHER)
+      contentType(home) must beNone
     }
   }
 }
Fix integration test for redirect from main page
