aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/log_subscriber_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Remove redundant test setups in log_subscriber_testst00122019-04-241-21/+1
| | | | | | | Because controllers' `perform_caching` config is `true` by default, it means we actually enable the caching in all those tests implicitly (and it works). Which also means we can avoid repeatedly declaring that and just specify it once in the setup method (just for declaration).
* Revert ensure external redirects are explicitly allowedGannon McGibbon2019-01-221-2/+2
|
* Ensure external redirects are explicitly allowedGannon McGibbon2019-01-171-2/+2
| | | | Add `fallback_location` and `allow_other_host` options to `redirect_to`.
* Turn on performance based copsDillon Welch2018-07-231-3/+1
| | | | | | | | | | | | | | | | Use attr_reader/attr_writer instead of methods method is 12% slower Use flat_map over map.flatten(1) flatten is 66% slower Use hash[]= instead of hash.merge! with single arguments merge! is 166% slower See https://github.com/rails/rails/pull/32337 for more conversation
* Merge pull request #31099 from nobu/patch-1Rafael Mendonça França2017-11-091-1/+1
|\ | | | | | | Use `Tempfile.create`
| * Use `Dir.mktmpdir`Nobuyoshi Nakada2017-11-091-1/+1
| | | | | | | | As `@cache_path` is expected to be a directory name, use `Dir.mktmpdir`. And omit unnecessary `Dir.tmpdir`.
| * Use `Tempfile.create`Nobuyoshi Nakada2017-11-091-1/+1
|/ | | Instead of `Dir::Tmpname.make_tmpname`, an internal method which does not guarantee uniqueness, use `Tempfile.create`.
* Use frozen string literal in actionpack/Kir Shatrov2017-07-291-0/+2
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* Add three new rubocop rulesRafael Mendonça França2016-08-161-1/+1
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* Assign config on base instead of on `@controller`.Kasper Timm Hansen2016-08-071-1/+1
| | | | | | | | | | | | | | In some test runs `ActionController::Base.enable_fragment_cache_logging` would be false, based on the test order. Turns out it was off because we assigned the config to the `@controller` variable, and not on `ActionController::Base`. The test failure was reproducible with, and now passes after this: ``` bin/test test/controller/log_subscriber_test.rb --seed 19918 ```
* Modify LogSubscriber for single partial's cache message.Stan Lo2016-08-081-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement naive partial caching mechanism. Add test for LogSubscriber Use ActionView::Base#log_payload to store log_subscriber's payload, so we can pass cache result into it. Fixed tests Remove useless settings Check if #log_payload exists before calling it. Because other classes also includes CacheHelper but don't have is attribute Use @log_payload_for_partial_reder instead of #log_payload to carry ActionView's payload. Update test's hash syntax Add configuration to enable/disable fragment caching logging Remove unless test and add new test to ensure cache info won't effect next rendering's log Move :enable_fragment_cache_logging config from ActionView to ActionPack Apply new config to tests Update actionview's changelog Update configuration guide Improve actionview's changelog Refactor PartialRenderer#render and log tests Mute subscriber's log instead of disabling instrumentation. Fix typo, remove useless comment and use new hash syntax Improve actionpack's log_subscriber test Fix rebase mistake Apply new config to all caching intstrument actions
* modernizes hash syntax in actionpackXavier Noria2016-08-061-8/+8
|
* applies new string literal convention in actionpack/testXavier Noria2016-08-061-10/+10
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Pass headers through to payload for logging.Gareth du Plooy2016-03-081-0/+6
| | | | Make request headers available in the event payload so that it is available to attached ActionController::LogSubscribers.
* tests, test should not care wether 9ms or 11ms have passed.Yves Senn2015-11-041-1/+1
| | | | | | | | This solves: ``` Expected /Completed 200 OK in [\d]ms/ to match "Completed 200 OK in 943ms". ```
* Deprecate passing hash as first parameter into ActionController::HeadMehmet Emin İNAÇ2015-06-151-1/+1
|
* Fix warning about ambiguous first argumentArun Agrawal2015-05-291-1/+1
|
* Deprecate `:nothing` option for render methodMehmet Emin İNAÇ2015-05-281-2/+2
| | | | `head` method works similar to `render` method with `:nothing` option
* Switch to kwargs in ActionController::TestCase and ActionDispatch::IntegrationKir Shatrov2015-01-291-5/+7
| | | | | | | | Non-kwargs requests are deprecated now. Guides are updated as well. `post url, nil, nil, { a: 'b' }` doesn't make sense. `post url, params: { y: x }, session: { a: 'b' }` would be an explicit way to do the same
* Ensure append_info_to_payload is called even if an exception is raised.Dieter Komendera2014-12-101-0/+20
| | | | | | | | See: * https://github.com/rails/rails/pull/14903 * https://github.com/roidrage/lograge/issues/37 Some code by mxrguspxrt from #14903.
* fix filesystem race conditionAaron Patterson2014-07-171-1/+1
|
* Clear filtered request attributes between requests in testsAndrew White2014-01-271-0/+11
| | | | | | | | The request attributes filtered_parameters, filtered_env and filtered_path are memoized for performance reasons. However this can cause unusual behavior in tests where there are multiple calls to get, post, etc. Fixes #13803.
* Removed :if and :unless from fragment cache option in favour ofAngelo capilleri2012-12-141-16/+16
| | | | | | | | | | | | | | | | | | | | | | | cache_if(condition, option, &block) and cache_unless(condition, option, &block). In the PR #8371 was introduced conditional options :if and :unless in the cache method. Example: <%= cache @model, if: some_condition(@model) do %> ... <%end%> This is a good feature but *cache_if* and and *cache_unless* are more concise and close to the standard of rails view helpers (ex: link_to_if and link_to_unless). Example: <%= cache_if condition, @model do %> ... <%end%>
* update documentation and code to use _action callbacksFrancesco Rodriguez2012-12-071-1/+1
|
* Allow fragment cache to accept :if and :unless optionsFabrizio Regini2012-12-051-0/+64
| | | | [Stephen Ausman + Fabrizio Regini]
* Adding filter capability to ActionController logsFabrizio Regini2012-12-051-0/+22
|
* extract AP Page and Action caching to actionpack-deprecated_caching gemFrancesco Rodriguez2012-10-031-18/+0
|
* log 404 status when ActiveRecord::RecordNotFound was raised (#7646)Yves Senn2012-09-171-0/+15
|
* Log 'Filter chain halted as CALLBACKNAME rendered or redirected' every time ↵José Valim2011-11-301-1/+12
| | | | a before callback halts.
* Ensure that status codes are logged properlyJesse Storimer2011-07-181-0/+19
| | | | | | Needed to move AC::Metal::Instrumentation before AM::Metal::Rescue so that status codes rendered from rescue_from blocks are logged properly.
* renamed the wrap_parameters :only and :except options to :include and ↵Josh Kalderimis2011-05-191-3/+3
| | | | :exclude to make it consistent with controller filters
* Improve performance for filtered parameters and add tests.José Valim2011-05-031-0/+11
|
* cleaning up some warnings on 1.9.3Aaron Patterson2011-02-071-10/+10
|
* A patch so that http status codes are still included in logs even during an ↵Doug Fales2011-01-251-0/+15
| | | | | | exception [#6333 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Issue one Cache#read command instead of two in the case of a fragment cache hitChristos Trochalakis2011-01-181-4/+4
|
* in regexps, the dot in a character class is not a metacharacterXavier Noria2010-10-151-1/+1
|
* fixing warnings with regexps on assert_matchAaron Patterson2010-10-011-2/+2
|
* fixing space errorAaron Patterson2010-09-291-1/+1
|
* Use parentheses when using assert_match followed by a regexp to avoid warnings.Emilio Tagua2010-09-271-13/+13
|
* Fix logging when cache key contains % sign [#5570 state:resolved]Krekoten' Marjan2010-09-251-0/+16
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Cleanup deprecation warnings in Action ControllerCarlos Antonio da Silva2010-09-061-13/+0
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Move Rails::LogSubscriber to ActiveSupport::LogSubscriber, allowing ↵José Valim2010-06-241-5/+5
| | | | frameworks like ActiveRecord and ActiveResource to log outsude Rails::Application [#4816 state:resolved]
* Make perform_caching work again, with the tests passing and backward compatibleSantiago Pastorino and Carl Lerche2010-04-151-4/+4
|
* Refactor cache_store to use ActionController configCarlhuda2010-03-041-2/+1
|
* Fix failing Action Pack testsCarlhuda2010-03-021-1/+2
|
* Revert "Fix test load paths for those not using bundler"Carlhuda2010-02-231-3/+0
| | | | | | This reverts commit eec2d301d4ce9df9c71c1a5aa63053eb970b6818. This commit broke tests. You cannot have a file called "bundler" on the load path.
* Makes send_file work again by deferring to Rack::Sendfile. Carlhuda2010-02-231-2/+2
| | | | | | | | | | * Add the Rack::Sendfile middleware * Make the header to use configurable via config.action_dispatch.x_sendfile_header (default to "X-Sendfile"). * Add Railties tests to confirm that these work * Remove the :stream, :buffer_size, and :x_senfile default options to send_file * Change the log subscriber to always say "Sent file" * Add deprecation warnings for options that are now no-ops Note that servers can configure this by setting X-Sendfile-Type. Hosting companies and those creating packages of servers specially designed for Rails applications are encouraged to specify this header so that this can work transparently.
* Merge master.José Valim2010-02-171-0/+3
|