1. 07 3月, 2016 1 次提交
    • Y
      Prevent not-intended loading of `ActionDispatch::IntegrationTest` · 9a642931
      yui-knk 提交于
      After 9d378747 `ActionDispatch::IntegrationTest`
      class is loaded and defined in all Rails environments, not only test but also
      production. This is not-intended loading of a class which is only used in
      test environment.
      To prevent not-intended loading, add `ActiveSupport.run_load_hooks` to
      `ActionDispatch::IntegrationTest` with `action_dispatch_integration_test` name
      and use it in `ActionMailer`.
      9a642931
  2. 03 3月, 2016 1 次提交
  3. 01 3月, 2016 1 次提交
  4. 13 2月, 2016 1 次提交
    • K
      Add fixes accidentally removed. · da1fbb9a
      Kasper Timm Hansen 提交于
      Yesterday, when improving how `parsed_body` extracted a parser I wrote
      77bbf1e9. Then I thought that was too many changes in one commit
      and broke it up locally... or so I thought.
      
      When pushed the extra commits removed the changes! Wups!
      
      In shame, lob those changes together here:
      
        * 3b94c38a which meant to fix the CHANGELOG syntax error.
        * 5007df5e which meant to mention `parsed_body` in the docs.
        * 036a7a03 which meant to memoize the `parsed_body`.
      da1fbb9a
  5. 12 2月, 2016 2 次提交
  6. 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
  7. 03 2月, 2016 1 次提交
  8. 05 1月, 2016 1 次提交
  9. 07 12月, 2015 1 次提交
    • E
      Push `before_sending` to super class · 492b1344
      eileencodes 提交于
      We want to get rid of the `Live::Response` so we are consolidating methods
      from `Live::Response` and `Response` by merging them together.
      
      This adds an `#empty` method to the request so we don't need to
      hard-code the empty array each time we call an empty
      `ActionDispatch::Request`.
      
      The work here is a continuation on combining controller and integration
      test code bases into one.
      492b1344
  10. 28 10月, 2015 1 次提交
  11. 07 10月, 2015 1 次提交
    • J
      Use `Mime[:foo]` instead of `Mime::Type[:FOO]` for back compat · 565094a8
      Jeremy Daer 提交于
      Rails 4.x and earlier didn't support `Mime::Type[:FOO]`, so libraries
      that support multiple Rails versions would've had to feature-detect
      whether to use `Mime::Type[:FOO]` or `Mime::FOO`.
      
      `Mime[:foo]` has been around for ages to look up registered MIME types
      by symbol / extension, though, so libraries and plugins can safely
      switch to that without breaking backward- or forward-compatibility.
      
      Note: `Mime::ALL` isn't a real MIME type and isn't registered for lookup
      by type or extension, so it's not available as `Mime[:all]`. We use it
      internally as a wildcard for `respond_to` negotiation. If you use this
      internal constant, continue to reference it with `Mime::ALL`.
      
      Ref. efc6dd55
      565094a8
  12. 22 9月, 2015 1 次提交
  13. 22 8月, 2015 1 次提交
  14. 08 8月, 2015 1 次提交
    • A
      stop using @_env in the controller instance · 81cfdf24
      Aaron Patterson 提交于
      Actions are processed through `dispatch`, so they should have the
      request set on them before any user land code can be executed.  Lets
      stop setting _env on the controller, and give access to it through the
      `env` method.
      81cfdf24
  15. 07 8月, 2015 1 次提交
  16. 28 7月, 2015 1 次提交
  17. 01 6月, 2015 1 次提交
  18. 30 5月, 2015 1 次提交
  19. 18 5月, 2015 1 次提交
  20. 02 5月, 2015 1 次提交
  21. 18 4月, 2015 1 次提交
  22. 10 3月, 2015 2 次提交
  23. 07 3月, 2015 1 次提交
  24. 27 2月, 2015 1 次提交
  25. 26 2月, 2015 1 次提交
    • J
      Fix default headers in test responses · f6e293ec
      Jeremy Kemper 提交于
      Fixes regression in #18423. Merge default headers for new responses,
      but don't merge when creating a response from the last session request.
      
      hat tip @senny 
      f6e293ec
  26. 14 2月, 2015 1 次提交
  27. 13 2月, 2015 8 次提交
    • G
      Correct module name in deprecation message. · 899e10f5
      Guo Xiang Tan 提交于
      899e10f5
    • G
      Improve deprecation message. · aca4c82d
      Guo Xiang Tan 提交于
      aca4c82d
    • G
      dbf38a06
    • A
      remove meta programming · b03b09dc
      Aaron Patterson 提交于
      there's really no benefit here.  It's the same number of lines without
      the meta programming and is faster
      b03b09dc
    • A
      4cf3b8ac
    • A
      lazily create the integration session · 303567e5
      Aaron Patterson 提交于
      now we don't have to call reset! everywhere
      303567e5
    • A
      fa634484
    • E
      Skip url_helpers instead of caching, speed up integration tests · 0acd4a57
      eileencodes 提交于
      We shouldn't cache if it's not absolutely necessary. Removes
      route caching and instead skips using the `url_helpers` is the
      integration test session doesn't require it. Benchmark ips on
      integration and controller index method tests below.
      
      Without any caching or changes to `#url_helpers`:
      ```
      Calculating -------------------------------------
      INDEX: Integration Test
                              71.000  i/100ms
      INDEX: Functional Test
                              99.000  i/100ms
      -------------------------------------------------
      INDEX: Integration Test
                              728.878  (± 8.0%) i/s -      3.692k
      INDEX: Functional Test
                                1.015k (± 6.7%) i/s -      5.148k
      
      Comparison:
      INDEX: Functional Test:     1015.4 i/s
      INDEX: Integration Test:      728.9 i/s - 1.39x slower
      ```
      
      With caching on `#url_helpers`:
      ```
      Calculating -------------------------------------
      INDEX: Integration Test
                              74.000  i/100ms
      INDEX: Functional Test
                              99.000  i/100ms
      -------------------------------------------------
      INDEX: Integration Test
                              752.377  (± 6.9%) i/s -      3.774k
      INDEX: Functional Test
                                1.021k (± 6.7%) i/s -      5.148k
      
      Comparison:
      INDEX: Functional Test:     1021.1 i/s
      INDEX: Integration Test:      752.4 i/s - 1.36x slower
      ```
      
      Afer removing the caching and bypassing the `url_helpers` when not
      necessary in the session:
      ```
      Calculating -------------------------------------
      INDEX: Integration Test
                              87.000  i/100ms
      INDEX: Functional Test
                              97.000  i/100ms
      -------------------------------------------------
      INDEX: Integration Test
                              828.433  (± 6.4%) i/s -      4.176k
      INDEX: Functional Test
                              926.763  (± 7.2%) i/s -      4.656k
      
      Comparison:
      INDEX: Functional Test:      926.8 i/s
      INDEX: Integration Test:      828.4 i/s - 1.12x slower
      ```
      0acd4a57
  28. 01 2月, 2015 1 次提交
  29. 29 1月, 2015 3 次提交