title: How to unit-test a JSON controller?
body: <p>This is my action:</p>
  
  <pre><code>def my_action
    str = ... # get json str somehow  
    render :json =&gt; str
  end
  </code></pre>
  
  <p>This is my test:</p>
  
  <pre><code>test "my test" do 
    post(:my_action, {'param' =&gt; "value"}    
    assert_response :success
  end
  </code></pre>
  
  <p>I want to add another assertion that the emitted JSON contains some value. How can I do it in a controller unit-test, not via parsing the view result?</p>