1. 22 2月, 2016 2 次提交
  2. 20 2月, 2016 1 次提交
    • K
      Make collection caching explicit. · b4558c10
      Kasper Timm Hansen 提交于
      Having collection caching that wraps templates and automatically tries
      to infer if they are cachable proved to be too much of a hassle.
      
      We'd rather have it be something you explicitly turn on.
      
      This removes much of the code and docs to explain the previous automatic
      behavior.
      
      This change also removes scoped cache keys and passing cache_options.
      b4558c10
  3. 19 2月, 2016 4 次提交
  4. 18 2月, 2016 1 次提交
  5. 17 2月, 2016 1 次提交
  6. 16 2月, 2016 2 次提交
  7. 15 2月, 2016 2 次提交
  8. 13 2月, 2016 3 次提交
  9. 12 2月, 2016 1 次提交
  10. 11 2月, 2016 1 次提交
    • K
      Add `parsed_body` to spare writing out parsing routines. · eee3534b
      Kasper Timm Hansen 提交于
      When testing:
      
      ```ruby
      post articles_path, params: { article: { title: 'Ahoy!' } }, as: :json
      ```
      
      It's common to want to make assertions on the response body. Perhaps the
      server responded with JSON, so you write `JSON.parse(response.body)`.
      But that gets tedious real quick.
      
      Instead add `parsed_body` which will automatically parse the reponse
      body as what the last request was encoded `as`.
      eee3534b
  11. 06 2月, 2016 1 次提交
    • A
      disable controller / view thread spawning in tests · a640da45
      Aaron Patterson 提交于
      Tests can (and do) access the database from the main thread.  In this
      case they were starting a transaction, then making a request.  The
      request would create a new thread, which would allocate a new database
      connection.  Since the main thread started a transaction that contains
      data that the new thread wants to see, the new thread would not see it
      due to data visibility from transactions.  Spawning the new thread in
      production is fine because middleware should not be doing database
      manipulation similar to the test harness.  Before 603fe20c it was
      possible to set the database connection id based on a thread local, but
      603fe20c changes the connection lookup code to never look at the
      "connection id" but only at the thread object itself.  Without that
      indirection, we can't force threads to use the same connection pool as
      another thread.
      
      Fixes #23483
      a640da45
  12. 30 1月, 2016 2 次提交
    • E
      Handle response_body= when body is nil · c4d85dfb
      eileencodes 提交于
      There are some cases when the `body` in `response_body=` can be set to
      nil. One of those cases is in `actionpack-action_caching` which I found
      while upgrading it for Rails 5.
      
      It's not possible to run `body.each` on a `nil` body so we have to
      return after we run `response.reset_body!`.
      c4d85dfb
    • Y
      remove unused variable from render test · 647a04cd
      yuuji.yaginuma 提交于
      This removes the following warning.
      
      ```
      rails/actionpack/test/controller/render_test.rb:278: warning: assigned but unused variable - response
      ```
      647a04cd
  13. 29 1月, 2016 2 次提交
    • E
      Run `file.close` before unlinking for travis · 5181d5c2
      eileencodes 提交于
      This works on OSX but for some reason travis is throwing a
      ```
        1) Error:
      ExpiresInRenderTest#test_dynamic_render_with_absolute_path:
      NoMethodError: undefined method `unlink' for nil:NilClass
      ```
      Looking at other tests in Railties the file has a name and we close
      it before unlinking, so I'm going to try that.
      5181d5c2
    • E
      Regression test for rendering file from absolute path · 020d6fda
      eileencodes 提交于
      Test that we are not allowing you to grab a file with an absolute path
      outside of your application directory. This is dangerous because it
      could be used to retrieve files from the server like `/etc/passwd`.
      020d6fda
  14. 27 1月, 2016 4 次提交
  15. 23 1月, 2016 1 次提交
  16. 22 1月, 2016 2 次提交
  17. 21 1月, 2016 1 次提交
    • J
      Re-add ActionController::ApiRendering · 77acc004
      Jon Moss 提交于
      - Fixes bug #23142.
      - Bug was occurring only with ActionController::API, because `_process_options` wasn't being run for API requests, even though it was being run for normal app requests.
      77acc004
  18. 20 1月, 2016 4 次提交
  19. 17 1月, 2016 1 次提交
    • E
      Remove literal? check to fix issue with prefixed optionals · 5d1b7c3b
      eileencodes 提交于
      In commit d993cb36 `build_path` was changed from using `grep` to
      `find_all` to save array allocations.
      
      This change was a little too aggressive in that when the dash comes
      before the symbol like `/omg-:song` the symbol is skipped.
      
      Removing the check for `n.right.left.literal?` fixes this issue, but
      does add back some allocations. The number of allocations are still well
      less than before.
      
      I've added a regression test to test this behavior for the future.
      
      Fixes #23069.
      
      Array allocations as of d993cb36:
      
      ```
      {:T_SYMBOL=>11}
      {:T_REGEXP=>17}
      {:T_STRUCT=>6500}
      {:T_MATCH=>12004}
      {:T_OBJECT=>91009}
      {:T_DATA=>100088}
      {:T_HASH=>114013}
      {:T_STRING=>159637}
      {:T_ARRAY=>321056}
      {:T_IMEMO=>351133}
      ```
      
      Array allocations after this change:
      
      ```
      {:T_SYMBOL=>11}
      {:T_REGEXP=>1017}
      {:T_STRUCT=>6500}
      {:T_MATCH=>12004}
      {:T_DATA=>84092}
      {:T_OBJECT=>87009}
      {:T_HASH=>110015}
      {:T_STRING=>166152}
      {:T_ARRAY=>322056}
      {:T_NODE=>343558}
      ```
      5d1b7c3b
  20. 13 1月, 2016 1 次提交
  21. 09 1月, 2016 1 次提交
  22. 05 1月, 2016 2 次提交