forked from pepite/lunatech-blog-engine
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add smoke test and remove play json from the dependencies (#74)
* remove play json from the dependencies It should not be necessary since it's pulled by the play framework * Add a smoke test for the application * add smoke test in scalatest instead of bash script
- Loading branch information
1 parent
96b60d8
commit 0b13bb1
Showing
3 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
import org.scalatestplus.play.PlaySpec | ||
import org.scalatestplus.play.guice.GuiceOneServerPerSuite | ||
import play.api.libs.ws.WSClient | ||
import org.scalatest._ | ||
import org.scalatestplus.play._ | ||
|
||
import play.api.test._ | ||
import play.api.test.Helpers.{GET => GET_REQUEST, _} | ||
import play.api.Application | ||
import play.api.inject.guice.GuiceApplicationBuilder | ||
|
||
class SmokeTest extends PlaySpec with GuiceOneServerPerSuite { | ||
|
||
override def fakeApplication(): Application = { | ||
GuiceApplicationBuilder() | ||
.configure( | ||
"accessToken" -> sys.env.get("GITHUB_TOKEN").getOrElse("dummy") | ||
) | ||
.build() | ||
} | ||
|
||
"should return some page" in { | ||
val wsClient = app.injector.instanceOf[WSClient] | ||
val response = await(wsClient.url(s"http://localhost:$port/").withVirtualHost("blog.lunatech.com").get()) | ||
response.status mustBe OK | ||
} | ||
} |