-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Walker Crouse <[email protected]>
- Loading branch information
0 parents
commit ac3c807
Showing
14 changed files
with
198 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
logs | ||
project/project | ||
project/target | ||
target | ||
tmp | ||
.history | ||
dist | ||
/.idea | ||
/*.iml | ||
/out | ||
/.idea_modules | ||
/.classpath | ||
/.project | ||
/RUNNING_PID | ||
/.settings | ||
|
||
|
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,12 @@ | ||
package controllers | ||
|
||
import play.api._ | ||
import play.api.mvc._ | ||
|
||
object Application extends Controller { | ||
|
||
def index = Action { | ||
Ok(views.html.index("Your new application is ready.")) | ||
} | ||
|
||
} |
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,7 @@ | ||
@(message: String) | ||
|
||
@main("Welcome to Play") { | ||
|
||
@play20.welcome(message) | ||
|
||
} |
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,15 @@ | ||
@(title: String)(content: Html) | ||
|
||
<!DOCTYPE html> | ||
|
||
<html> | ||
<head> | ||
<title>@title</title> | ||
<link rel="stylesheet" media="screen" href="@routes.Assets.at("stylesheets/main.css")"> | ||
<link rel="shortcut icon" type="image/png" href="@routes.Assets.at("images/favicon.png")"> | ||
<script src="@routes.Assets.at("javascripts/jquery-1.9.0.min.js")" type="text/javascript"></script> | ||
</head> | ||
<body> | ||
@content | ||
</body> | ||
</html> |
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,13 @@ | ||
name := "pore" | ||
|
||
version := "1.0" | ||
|
||
lazy val `pore` = (project in file(".")).enablePlugins(PlayScala) | ||
|
||
scalaVersion := "2.11.7" | ||
|
||
libraryDependencies ++= Seq( jdbc , cache , ws , specs2 % Test ) | ||
|
||
unmanagedResourceDirectories in Test <+= baseDirectory ( _ /"target/web/public/test" ) | ||
|
||
resolvers += "scalaz-bintray" at "https://dl.bintray.com/scalaz/releases" |
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,59 @@ | ||
# This is the main configuration file for the application. | ||
# ~~~~~ | ||
|
||
# Secret key | ||
# ~~~~~ | ||
# The secret key is used to secure cryptographics functions. | ||
# If you deploy your application to several instances be sure to use the same key! | ||
application.secret="%APPLICATION_SECRET%" | ||
|
||
# The application languages | ||
# ~~~~~ | ||
application.langs="en" | ||
|
||
# Global object class | ||
# ~~~~~ | ||
# Define the Global object class for this application. | ||
# Default to Global in the root package. | ||
# application.global=Global | ||
|
||
# Router | ||
# ~~~~~ | ||
# Define the Router object to use for this application. | ||
# This router will be looked up first when the application is starting up, | ||
# so make sure this is the entry point. | ||
# Furthermore, it's assumed your route file is named properly. | ||
# So for an application router like `my.application.Router`, | ||
# you may need to define a router file `conf/my.application.routes`. | ||
# Default to Routes in the root package (and conf/routes) | ||
# application.router=my.application.Routes | ||
|
||
# Database configuration | ||
# ~~~~~ | ||
# You can declare as many datasources as you want. | ||
# By convention, the default datasource is named `default` | ||
# | ||
# db.default.driver=org.h2.Driver | ||
# db.default.url="jdbc:h2:mem:play" | ||
# db.default.user=sa | ||
# db.default.password="" | ||
|
||
# Evolutions | ||
# ~~~~~ | ||
# You can disable evolutions if needed | ||
# evolutionplugin=disabled | ||
|
||
# Logger | ||
# ~~~~~ | ||
# You can also configure logback (http://logback.qos.ch/), | ||
# by providing an application-logger.xml file in the conf directory. | ||
|
||
# Root logger: | ||
logger.root=ERROR | ||
|
||
# Logger used by the framework: | ||
logger.play=INFO | ||
|
||
# Logger provided to your application: | ||
logger.application=DEBUG | ||
|
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,11 @@ | ||
# Routes | ||
# This file defines all application routes (Higher priority routes first) | ||
# ~~~~ | ||
|
||
# Home page | ||
GET / controllers.Application.index | ||
|
||
# Map static resources from the /public folder to the /assets URL path | ||
GET /assets/*file controllers.Assets.at(path="/public", file) | ||
|
||
|
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 @@ | ||
sbt.version=0.13.5 |
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,5 @@ | ||
logLevel := Level.Warn | ||
|
||
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/" | ||
|
||
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.4.2") |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Empty file.
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,30 @@ | ||
import org.specs2.mutable._ | ||
import org.specs2.runner._ | ||
import org.junit.runner._ | ||
|
||
import play.api.test._ | ||
import play.api.test.Helpers._ | ||
|
||
/** | ||
* Add your spec here. | ||
* You can mock out a whole application including requests, plugins etc. | ||
* For more information, consult the wiki. | ||
*/ | ||
@RunWith(classOf[JUnitRunner]) | ||
class ApplicationSpec extends Specification { | ||
|
||
"Application" should { | ||
|
||
"send 404 on a bad request" in new WithApplication{ | ||
route(FakeRequest(GET, "/boum")) must beNone | ||
} | ||
|
||
"render the index page" in new WithApplication{ | ||
val home = route(FakeRequest(GET, "/")).get | ||
|
||
status(home) must equalTo(OK) | ||
contentType(home) must beSome.which(_ == "text/html") | ||
contentAsString(home) must contain ("Your new application is ready.") | ||
} | ||
} | ||
} |
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,24 @@ | ||
import org.specs2.mutable._ | ||
import org.specs2.runner._ | ||
import org.junit.runner._ | ||
|
||
import play.api.test._ | ||
import play.api.test.Helpers._ | ||
|
||
/** | ||
* add your integration spec here. | ||
* An integration test will fire up a whole play application in a real (or headless) browser | ||
*/ | ||
@RunWith(classOf[JUnitRunner]) | ||
class IntegrationSpec extends Specification { | ||
|
||
"Application" should { | ||
|
||
"work from within a browser" in new WithBrowser { | ||
|
||
browser.goTo("http://localhost:" + port) | ||
|
||
browser.pageSource must contain("Your new application is ready.") | ||
} | ||
} | ||
} |