Last active
August 29, 2015 14:14
-
-
Save khalidr/54c6d67fa6b7cd5efa8b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import spray.routing._ | |
class UsersRouteSpec extends RouteSpec with UsersRoute with PlayJsonSupport with MockitoSugar{ | |
//TODO: write some negative tests - particularly, failed credential update | |
it must "reject a get request if the session user is not authorized" in { | |
val fakeRoute = authorize(false){ | |
complete{ | |
StatusCodes.OK | |
} | |
} | |
Get("/") ~> addHeader("session", fakeSessionId.toString) ~> | |
fakeRoute ~> check{ | |
println("^^^^^^^^"+status) | |
rejection mustBe AuthorizationFailedRejection | |
//status mustBe StatusCodes.Unauthorized | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i get