Skip to content
This repository has been archived by the owner on Apr 10, 2019. It is now read-only.

Commit

Permalink
#150, refactor: fixed broken test template
Browse files Browse the repository at this point in the history
  • Loading branch information
slavaschmidt committed Jun 16, 2016
1 parent a2ce73b commit a3c7ddb
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ import Generators._
val files: Seq[FilePart[TemporaryFile]] = {{for p in test.form_parameters}}{{if p.is_file}}{{if p.optional}}{{p.field_name}}.toSeq.map { m => FilePart("{{p.field_name}}", m.getName, Some("Content-Type: multipart/form-data"), TemporaryFile(m)) } ++ {{else}}Seq(FilePart("{{p.field_name}}", {{p.field_name}}.getName, Some("Content-Type: multipart/form-data"), TemporaryFile({{p.field_name}}))) ++ {{/if}}{{/if}}{{/for}}Nil
val data = Map.empty[String, Seq[String]] {{for p in test.form_parameters}} {{if p.is_file}} {{else}} {{if p.optional}}++ {{p.field_name}}.map(m => "{{p.field_name}}" -> Seq(m.toString)).toSeq{{else}}++ Seq("{{p.field_name}}" -> Seq({{p.field_name}}.toString)) {{/if}} {{/if}} {{/for}}
val form = new MultipartFormData(data, files, Nil, Nil)
val form = new MultipartFormData(data, files, Nil)

route(request.withMultipartFormDataBody(form)).get
} else if (contentType == "application/x-www-form-urlencoded") {
Expand Down Expand Up @@ -136,7 +136,7 @@ import Generators._
val files: Seq[FilePart[TemporaryFile]] = {{for p in test.form_parameters}}{{if p.is_file}}{{if p.optional}}{{p.field_name}}.toSeq.map { m => FilePart("{{p.field_name}}", m.getName, Some("Content-Type: multipart/form-data"), TemporaryFile(m)) } ++ {{else}}Seq(FilePart("{{p.field_name}}", {{p.field_name}}.getName, Some("Content-Type: multipart/form-data"), TemporaryFile({{p.field_name}}))) ++ {{/if}}{{/if}}{{/for}}Nil
val data = Map.empty[String, Seq[String]] {{for p in test.form_parameters}} {{if p.is_file}} {{else}} {{if p.optional}}++ {{p.field_name}}.map(m => "{{p.field_name}}" -> Seq(m.toString)).toSeq{{else}}++ Seq("{{p.field_name}}" -> Seq({{p.field_name}}.toString)) {{/if}} {{/if}} {{/for}}
val form = new MultipartFormData(data, files, Nil, Nil)
val form = new MultipartFormData(data, files, Nil)

route(request.withMultipartFormDataBody(form)).get
} else if (contentType == "application/x-www-form-urlencoded") {
Expand Down

0 comments on commit a3c7ddb

Please sign in to comment.