We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
for example:
package controllers import org.specs2.mutable._ import play.api.test._ import com.mohiva.play.silhouette.test._ import com.mohiva.play.silhouette.api.LoginInfo import com.mohiva.play.silhouette.impl.authenticators.JWTAuthenticator import models.users._ import models.authorizations._ class RestApplicationControllerSpec extends PlaySpecification { val baseInfo = BaseInfo( firstName = Some("Ale"), lastName = Some("Random"), fullName = None, gender = Some("M")) val user = User( id = java.util.UUID.randomUUID.toString, loginInfo = LoginInfo("facebook", "[email protected]"), socials = None, email = None, username = None, avatarUrl = None, info = baseInfo, roles = Set(SimpleUser)) "The `user` method" should { "return status 200 if authenticator and identity was found" in new WithApplication { val identity = user implicit val fakeEnv = FakeEnvironment[User, JWTAuthenticator](Seq(identity.loginInfo -> identity)) val request = FakeRequest().withAuthenticator(identity.loginInfo) val controller = new controllers.RestApplicationController { override implicit lazy val env = fakeEnv } val result = controller.onlyGodOrUser(request) status(result) must equalTo(OK) contentAsString(result) mustEqual "{\"result\":\"Oh yess GOD\"}" } } }
The text was updated successfully, but these errors were encountered:
datalek
No branches or pull requests
for example:
The text was updated successfully, but these errors were encountered: