I want to test when user has no authority.
mt-sito opened this issue · comments
I want to test authorize with FakeRequest.
val Some(result) = route(app, FakeRequest(GET, "/path1").withLoggedIn(config)(1))
// "1" user is logged in but it has no authority.
assert(status(result) === UNAUTHORIZED) // Returned OK
val Some(result) = route(app, FakeRequest(GET, "/path1").withLoggedIn(config)(2))
// "2" user is logged in and it has authority.
assert(status(result) === OK)
Sorry.It was a misunderstanding. I was able to do it.