This repository has been archived by the owner on Aug 14, 2023. It is now read-only.
forked from heiflo/play21-file-upload-streaming
-
Notifications
You must be signed in to change notification settings - Fork 8
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
12 additions
and
34 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,7 @@ | ||
@(message: String) | ||
|
||
@main("Play Scala File Upload") { | ||
|
||
@main(message) { | ||
@helper.form(action = routes.Application.upload, 'enctype -> "multipart/form-data") { | ||
|
||
<input type="file" name="file"> | ||
<p><input type="submit"></p> | ||
|
||
} | ||
|
||
|
||
|
||
} |
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,33 +1,26 @@ | ||
package test | ||
|
||
import org.specs2.mutable._ | ||
|
||
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. | ||
*/ | ||
class ApplicationSpec extends Specification { | ||
|
||
"Application" should { | ||
|
||
"send 404 on a bad request" in { | ||
running(FakeApplication()) { | ||
route(FakeRequest(GET, "/boum")) must beNone | ||
route(FakeRequest(GET, "/boum")) must beNone | ||
} | ||
} | ||
|
||
"render the index page" in { | ||
running(FakeApplication()) { | ||
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.") | ||
contentAsString(home) must contain (controllers.Application.welcomeMsg) | ||
} | ||
} | ||
} | ||
} | ||
} |
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