title: Unable to test controller using Action.async
body: <p>I'm trying to test controller, which is using new <code>Action.async</code>. Following <a href="http://www.playframework.com/documentation/2.2.x/ScalaTest">documentation</a> I have excluded part under controller I want to test to separate trait with type reference:</p>
  
  <pre><code>trait UserController { this: Controller =&gt;
    def index() = Action { /* snip */ }
    def register() = Action.async(parse.json) { request =&gt; /* snip */ }
  }
  </code></pre>
  
  <p>Documentation states that I'm supposed to test it as:</p>
  
  <pre><code>object UsersControllerSpec extends PlaySpecification with Results {
    class TestController() extends Controller with UserController
      "index action" should {
        "should be valid" in {
          val controller = new TestController()
          val result: Future[SimpleResult] = controller.index().apply(FakeRequest())
          /* assertions */
        }
      }
    }
  }
  </code></pre>
  
  <p>For <code>index()</code> method it works perfectly, unfortunately I'm not able to do the same with <code>register()</code>, as applying FakeRequest on it returns instance of <code>Iteratee[Array[Byte], SimpleResult]</code>. I've noticed it has <code>run()</code> method that returns <code>Future[SimpleResult]</code> but no matter how I build <code>FakeRequest</code> it returns with <code>400</code> without any content or headers. Seems to me like content of <code>FakeRequest</code> is disregarded at all. Am I supposed to feed request body to iteratee somehow and then run it? I couldn't find any example how could I do that.</p>