aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/test_case.rb
Commit message (Collapse)AuthorAgeFilesLines
* Bug fix for assert_template when opening a new session.Guo Xiang Tan2014-07-251-5/+9
| | | | See https://github.com/rails/rails/pull/16234#commitcomment-7115670.
* Fix AC::TemplateAssertions instance variables not resetting.Guo Xiang Tan2014-07-211-5/+7
| | | | Fixes https://github.com/rails/rails/issues/16119.
* Reduce number of subscriptions created.Guo Xiang Tan2014-07-081-17/+13
|
* Remove symbolized_path_parameters.Guo Xiang Tan2014-07-021-1/+0
| | | | This pull request is a continuation of https://github.com/rails/rails/commit/925bd975 and https://github.com/rails/rails/commit/8d8ebe3d.
* Merge pull request #15537 from tgxworld/fix_state_leakMatthew Draper2014-06-201-1/+0
|\ | | | | Fix state leak.
| * Prevent state leak.Guo Xiang Tan2014-06-051-1/+0
| |
* | Set flash in test session when necessary.Guo Xiang Tan2014-06-121-2/+5
|/ | | | `to_session_value` returns nil when empty.
* use symbol keys for path_parametersAaron Patterson2014-05-221-5/+5
|
* Fix examples indent and improve #process docs a bit [ci skip]Carlos Antonio da Silva2014-05-041-16/+14
|
* Document ActionController::TestCase::Behavior#processGaurish Sharma2014-05-041-0/+27
| | | | [ci skip]
* Fix subscriptions not being unsubscribed.Guo Xiang Tan2014-04-141-5/+7
|
* update comments to reflect that options support is not availableFrederick Cheung2014-03-251-2/+2
|
* use the body proxy to freeze headersAaron Patterson2014-03-121-1/+1
| | | | | | avoid freezing the headers until the web server has actually read data from the body proxy. Once the webserver has read data, then we should throw an error if someone tries to set a header
* only write the jar if the response isn't committedAaron Patterson2014-03-121-1/+15
| | | | | | | | | | | when streaming responses, we need to make sure the cookie jar is written to the headers before returning up the stack. This commit introduces a new method on the response object that writes the cookie jar to the headers as the response is committed. The middleware and test framework will not write the cookie headers if the response has already been committed. fixes #14352
* live controllers should have live responsesAaron Patterson2014-02-281-6/+22
| | | | | | detect the type of controller we're testing and return the right type of response based on that controller. This allows us to stop doing the weird sleep thing.
* Fix controller test not resetting @_url_optionsTony Wooster2014-02-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 4f2cd3e9 introduced a bug by reordering the call to `@controller.recycle!` above the call to `build_request_uri`. The impact of this was that the `@_url_options` cache ends up not being reset between building a request URI (occurring within the test controller) and the firing of the actual request. We encountered this bug because we had the following setup: class MinimumReproducibleController < ActionController::Base before_filter { @param = 'param' } def index render text: url_for(params) end def default_url_options { custom_opt: @param } end end def test_index get :index # builds url, then fires actual request end The first step in `get :index` in the test suite would populate the @_url_options cache. The subsequent call to `url_for` inside of the controller action would then utilize the uncleared cache, thus never calling the now-updated default_url_options. This commit fixes this bug calling recycle! twice, and removes a call to set response_body, which should no longer be needed since we're recycling the request object explicitly.
* Clear filtered request attributes between requests in testsAndrew White2014-01-271-0/+3
| | | | | | | | 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.
* Re-remove deprecated API.kennyj2013-06-281-12/+0
|
* Revert "Add the options method to action_controller testcase."Rafael Mendonça França2013-05-161-6/+0
| | | | | | | | | | | | This reverts commit 0303c2325fab253adf5e4a0b738cb469c048f008. Conflicts: actionpack/lib/action_controller/test_case.rb REASON: It will conflict with a lot of test cases. Better to call `process` directly since this is a very uncommon HTTP method. Fixes #10638.
* use canonical #controller_path logic in controller test casesLance Ivy2013-05-051-1/+1
|
* applies documentation guidelinesXavier Noria2013-04-221-11/+12
|
* Remove unused block parametersAgis Anastasopoulos2013-04-071-3/+3
|
* Prefer find_by over dynamic finders in rdocSam Ruby2013-04-021-1/+1
|
* Fix typos and improve docs a bit [ci skip]Carlos Antonio da Silva2013-03-151-7/+5
|
* document request simulation methods in functional tests.Yves Senn2013-03-151-7/+27
|
* Skip fetching path if the iteration is going to be skippedCarlos Antonio da Silva2013-03-111-2/+2
|
* Allow use of assert_template with the :file option.Justin Coyne2013-03-011-1/+16
| | | | This worked in Rails 3.2, but was a regression in 4.0.0.beta1
* partials inside directory work with `assert_template`Yves Senn2013-02-041-1/+2
| | | | | | | | | | previously when a partial was placed inside a directory (eg. '/dir/_partial'), `assert_template` did not replace the '_' prefix when looking through rendered tempaltes, which resulted in an error. I modified it to replace both, the leading '_' and the last '_' after a '/'.
* descriptive `assert_template` error when partial wasn't renderedYves Senn2013-02-041-0/+3
| | | | | | | When `assert_template` is used with the :locals option, and the partial was not rendered, a method_missing error was raised. This changes first checks, if the partial actually was rendered and raises a descriptive error.
* Missing require hash/keysAkira Matsuda2013-02-011-0/+1
|
* Add keys/values methods to TestSessionCarlos Antonio da Silva2013-01-251-0/+8
| | | | Bring back the same API we have with Request::Session.
* Integrate Action Pack with Rack 1.5Carlos Antonio da Silva2013-01-251-1/+14
| | | | | | All ActionPack and Railties tests are passing. Closes #8891. [Carlos Antonio da Silva + Santiago Pastorino]
* Revert "Merge pull request #8989 from robertomiranda/use-rails-4-find-by"Guillermo Iguaran2013-01-181-1/+1
| | | | | This reverts commit 637a7d9d357a0f3f725b0548282ca8c5e7d4af4a, reversing changes made to 5937bd02dee112646469848d7fe8a8bfcef5b4c1.
* User Rails 4 find_byrobertomiranda2013-01-181-1/+1
|
* Remove useless || operationCarlos Antonio da Silva2013-01-171-2/+1
|
* Inherit from MiniTest::Unit::TestCase instead of MiniTest::SpecRafael Mendonça França2012-12-311-7/+0
|
* assert_template: validating option keysRoberto Soares2012-11-251-0/+2
|
* `assert_template` fails with empty string.Roberto Soares2012-11-231-8/+4
|
* `assert_template` fails with empty string when a template has been renderedRoberto Soares2012-11-231-4/+8
| | | | | | | | For instance, it prevents false positive in this case: file = nil get :index assert_template("#{file}")
* Store FlashHashes in the session as plain hashes rather than custom objects ↵James Coglan2012-11-091-1/+2
| | | | | | | | | | | | | | | | | | | | with unstable class names and instance variables. Refactor FlashHash to take values for its ivars in the constructor, to pretty up FlashHash.from_session_value. Remove stale comment on FlashHash: it is no longer Marshaled in the session so we can change its implementation. Remove blank lines I introduced in controller/test_case.rb. Unit tests for FlashHash#to_session_value. Put in a compatibility layer to accept FlashHash serializations from Rails 3.0+. Test that Rails 3.2 session flashes are correctly converted to the new format. Remove code path for processing Rails 3.0 FlashHashes since they can no longer deserialize. Fix session['flash'] deletion condition: it will never be empty?, it will either be nil or a hash with 'discard' and 'flashes' keys.
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-11-031-11/+11
|\ | | | | | | | | | | | | Conflicts: actionpack/lib/action_controller/metal/mime_responds.rb activerecord/lib/active_record/attribute_methods.rb guides/source/working_with_javascript_in_rails.md
| * Multiple changes to 1,9 hash syntaxAvnerCohen2012-10-271-11/+11
| |
* | Provide a call stack for deprecation warnings where needed.Nikita Afanasenko2012-10-291-3/+3
|/ | | | It's sometimes hard to quickly find where deprecated call was performed, especially in case of migrating between Rails versions. So this is an attempt to improve the call stack part of the warning message by providing caller explicitly.
* refactor `ActionView::TestCase` internals to track rendered localsYves Senn2012-10-111-9/+4
| | | | | this refactoring extracts the semi complex data structure of rendered locals per view into into a separate class
* recognizes when a partial was rendered twice. Closes #3675Yves Senn2012-10-111-4/+10
|
* can't pass :locals to #assert_template without a view test case. Closes #3415Yves Senn2012-10-061-3/+7
| | | | | | | | | | | the documentation on #assert_template states that the :locals option is only available in view test cases: # In a view test case, you can also assert that specific locals are passed # to partials: I added a warning when it's passed in an inapropriate context to prevent a NoMethodError.
* prefix TemplateAssertions ivars (#7459)Yves Senn2012-10-011-20/+20
|
* Whitespaces :scissors: [ci skip]Rafael Mendonça França2012-09-301-1/+1
|
* `assert_template` no more passing with what ever string that matches.Hugo Roque2012-09-291-5/+12
| | | | | | | | | | | | | | | | | | | | | | | Given Im rendering an template `/layout/hello.html.erb`, assert_template was passing with any string that matches. This behavior allowed false passing like: assert_template "layout" assert_template "out/hello" Now the passing possibilities are: assert_template "layout/hello" assert_template "hello" fixing assert_template bug when template matches expected, but not ends with Cherry Pick Merge: Fixes issue #3849 assert_template false positive taking redundant test off prevening incorrect assert_template when rendering with repeated names in path updating CHANGELOG with bugfix: assert_template false passing
* Also includes ConstantLookup dependency for controller and mailer testsAndy Lindeman2012-09-261-0/+1
|