-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Write simple tests, which test the routes for setup.
- Loading branch information
Showing
3 changed files
with
46 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.yetu.oauth2provider.routes | ||
|
||
import com.yetu.oauth2provider.base.BaseRoutesSpec | ||
import play.api.mvc.Result | ||
import play.api.test.FakeRequest | ||
import play.api.test.Helpers._ | ||
|
||
import scala.concurrent.Future | ||
|
||
/** | ||
* Created by elisahilprecht on 16/03/15. | ||
*/ | ||
class SetupSpec extends BaseRoutesSpec { | ||
|
||
def requestReturnOk(urlRequest: String): Future[Result] = { | ||
val Some(result) = route(FakeRequest(GET, urlRequest)) | ||
status(result) mustEqual (OK) | ||
return result; | ||
} | ||
|
||
"setup controller" must { | ||
"return registration page with title 'Registration'" in { | ||
val result = requestReturnOk(setupRegistrationUrl) | ||
contentAsString(result) must include("<title>Registration</title>") | ||
} | ||
"return confirm mail page with title 'Confirm e-mail'" in { | ||
val result = requestReturnOk(setupConfirmMailUrl) | ||
contentAsString(result) must include("<title>Confirm e-mail</title>") | ||
} | ||
"return confirmed mail page with title confirm 'Successfully confirmed mail'" in { | ||
val result = requestReturnOk(setupConfirmedMailUrl) | ||
contentAsString(result) must include("<title>Successfully confirmed mail</title>") | ||
} | ||
"return download page with title confirm 'Download'" in { | ||
val result = requestReturnOk(setupDownloadUrl) | ||
contentAsString(result) must include("<title>Download</title>") | ||
} | ||
} | ||
} |
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