Skip to content

Commit

Permalink
Merge pull request #11306 from mkurz/backport_DevErrorPageSpec_fix
Browse files Browse the repository at this point in the history
Use DevHttpErrorHandler to check if play.editor link gets rendered
  • Loading branch information
mkurz committed Jun 2, 2022
2 parents 6abbe41 + c127c1b commit ff320c4
Showing 1 changed file with 3 additions and 5 deletions.
Expand Up @@ -4,10 +4,8 @@

package play.it.views

import play.api.Configuration
import play.api.Environment
import play.api.Mode
import play.api.http.DefaultHttpErrorHandler
import play.api.http.DevHttpErrorHandler
import play.api.test._

class DevErrorPageSpec extends PlaySpecification {
Expand All @@ -20,8 +18,8 @@ class DevErrorPageSpec extends PlaySpecification {
}

"link the error line if play.editor is configured" in {
DefaultHttpErrorHandler.setPlayEditor("someEditorLinkWith %s:%s")
val result = DefaultHttpErrorHandler.onServerError(FakeRequest(), testExceptionSource)
DevHttpErrorHandler.setPlayEditor("someEditorLinkWith %s:%s")
val result = DevHttpErrorHandler.onServerError(FakeRequest(), testExceptionSource)
contentAsString(result) must contain("""href="someEditorLinkWith someSourceFile:100" """)
}

Expand Down

0 comments on commit ff320c4

Please sign in to comment.