This repository has been archived by the owner on Oct 24, 2022. It is now read-only.
-
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.
- Loading branch information
Showing
4 changed files
with
54 additions
and
3 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
@(message: String, redirectUrl: String) | ||
|
||
@layout.main("Welcome to Play") { | ||
@layout.main("Login to SCOAP3 - TopicHub") { | ||
<h2>Not Yet Authenticated</h2> | ||
<a href="@redirectUrl"><em><b>Log in with MITID!</b></em></a> | ||
<a id="openid" href="@redirectUrl"><em><b>Log in with MITID!</b></em></a> | ||
} |
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.specs2.mutable._ | ||
import org.specs2.runner._ | ||
import org.junit.runner._ | ||
import org.specs2.mock._ | ||
|
||
import play.api.test._ | ||
import play.api.test.Helpers._ | ||
import org.fest.assertions.Assertions.assertThat | ||
|
||
/** | ||
* add your integration spec here. | ||
* An integration test will fire up a whole play application in a real (or headless) browser | ||
*/ | ||
class AuthenticationSpec extends Specification with Mockito { | ||
"Application" should { | ||
"display a login screen" in new WithBrowser { | ||
browser.goTo("http://localhost:" + port + "/login") | ||
browser.pageSource must contain("Log in with MITID") | ||
assertThat(browser.title()).isEqualTo("Login to SCOAP3 - TopicHub") | ||
} | ||
|
||
"redirect when login is clicked" in new WithBrowser { | ||
browser.goTo("http://localhost:" + port + "/login") | ||
browser.$("#openid").click(); | ||
assertThat(browser.title()).isEqualTo("MIT OpenID Connect Pilot - Log In") | ||
} | ||
} | ||
} |