Skip to content

Instantly share code, notes, and snippets.

@irumiha
Created July 29, 2012 21:41
Show Gist options
  • Save irumiha/3201991 to your computer and use it in GitHub Desktop.
Save irumiha/3201991 to your computer and use it in GitHub Desktop.
package test
import org.specs2.mutable._
import play.api.test._
import play.api.test.Helpers._
class AuthenticationTests extends Specification {
"The authentication system" should {
"log out a logged in user" in {
running(FakeApplication()) {
val Some(r) = routeAndCall(FakeRequest(GET, "/logout").
withSession("username" -> "admin@bigsite"))
status(r) must equalTo(SEE_OTHER)
session(r).get("username") must beNone
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment