Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Finalized app by making use of the repo and changing specs accordingly
- Loading branch information
1 parent
4e707cb
commit 796b6c6
Showing
3 changed files
with
59 additions
and
6 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
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,14 +1,35 @@ | |||
import java.io.File | |||
import cassandra.{CassandraConnector, CassandraConnectionUri} | |||
import org.scalatest.BeforeAndAfter | |||
import org.scalatestplus.play._ | import org.scalatestplus.play._ | ||
import play.api | |||
import play.api.{Mode, Environment, ApplicationLoader} | |||
|
|
||
class IntegrationSpec extends PlaySpec with OneBrowserPerSuite with OneServerPerSuite with HtmlUnitFactory { | class IntegrationSpec extends PlaySpec with OneBrowserPerSuite with OneServerPerSuite with HtmlUnitFactory with BeforeAndAfter { | ||
|
|||
before { | |||
val uri = CassandraConnectionUri("cassandra://localhost:9042/test") | |||
val session = CassandraConnector.createSessionAndInitKeyspace(uri) | |||
val query = "INSERT INTO products (id, name) VALUES (1, 'Chair');" | |||
session.execute(query) | |||
session.close() | |||
} | |||
|
|||
override implicit lazy val app: api.Application = | |||
new AppLoader().load( | |||
ApplicationLoader.createContext( | |||
new Environment( | |||
new File("."), ApplicationLoader.getClass.getClassLoader, Mode.Test) | |||
) | |||
) | |||
|
|
||
"Application" should { | "Application" should { | ||
|
|
||
"work from within a browser" in { | "work from within a browser and tell us about the first product" in { | ||
|
|
||
go to "http://localhost:" + port | go to "http://localhost:" + port | ||
|
|
||
pageSource must include ("Your new application is ready.") | pageSource must include ("Your new application is ready. The name of product #1 is Chair.") | ||
} | } | ||
} | } | ||
} | } |