aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/test_case.rb
Commit message (Collapse)AuthorAgeFilesLines
...
* | Don't convert params if the request isn't HTML - fixes #5341Andrew White2012-04-291-6/+18
| |
* | Merge session arg with existing session instead of overwritingAndrew White2012-04-281-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | This may break existing tests that are asserting the whole session contents but should not break existing tests that are asserting individual keys - e.g: class SomeControllerTest < ActionController::TestCase setup do session['user_id'] = 1 end test "some test" do get :some_action, nil, { 'another_var' => 2 } # This assertion will now fail assert_equal({ 'another_var' => 2 }, session) # This assertion will still pass assert_equal 2, session['another_var] end end Fixes #1529.
* remove unnecessary else statementVasiliy Ermolovich2012-04-261-3/+3
|
* Remove obsolete codeAlexey Vakhov2012-04-121-3/+0
|
* We dont need to merge in the parameters as thats all being reset by the rack ↵David Heinemeier Hansson2012-03-201-1/+0
| | | | headers (and its causing problems for Strong Parameters attempt of wrapping request.parameters because it will change in testing)
* Remove ActionController::TestCase#rescue_action_in_public!Piotr Sarnacki2012-03-151-5/+0
| | | | | | This method has no effect since exception handling was moved to middlewares and ActionController tests do not use any middlewares.
* assert_template matches against RegexpGrant Hutchins2012-03-101-2/+7
| | | | | | | | | | | | | | | This allows for more strict template assertions, while maintaining backward compatibility. For example, if you use assert_template("foo/bar") and "foo/bar/baz" was rendered, the test passes. But if you use assert_template(%r{\Afoo/bar\Z}), you will catch that a different template was rendered. Also, if you passed an unsupported argument to assert_template() in the past, it would silently succeed. Now it raises an ArgumentError.
* force response body to be read in assert_templateSergey Nartimov2012-03-051-0/+4
|
* Add config.default_method_for_update to support PATCHDavid Lee2012-02-221-1/+6
| | | | | | | | | | | | | | | | PATCH is the correct HTML verb to map to the #update action. The semantics for PATCH allows for partial updates, whereas PUT requires a complete replacement. Changes: * adds config.default_method_for_update you can set to :patch * optionally use PATCH instead of PUT in resource routes and forms * adds the #patch verb to routes to detect PATCH requests * adds #patch? to Request * changes documentation and comments to indicate support for PATCH This change maintains complete backwards compatibility by keeping :put as the default for config.default_method_for_update.
* Dont do underscore and camelize, only camelize is fineSemyon Perepelitsa2012-01-311-1/+1
|
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-01-111-0/+1
|\
| * Add missing endRafael Mendonça França2012-01-101-0/+1
| |
* | AC:TestCase::Behavior#head only accepts parameters as second argumentRafael Mendonça França2012-01-101-1/+1
| |
* | Fix ActionController::TestCase::Behavior.headRafael Mendonça França2012-01-101-1/+1
| |
* | Merge pull request #4371 from rafaelfranca/test_unit_cleanupAaron Patterson2012-01-091-1/+1
|\ \ | | | | | | Test unit cleanup
| * | Whitespaces :scissors:Rafael Mendonça França2012-01-061-1/+1
| | |
* | | get rid of using instance_variable_names method from ASSergey Nartimov2012-01-071-2/+2
|/ / | | | | | | | | - instance_variables return symbols in 1.9 - there is instance_variable_defined? method
* | register spec subclasses for people who specAaron Patterson2012-01-061-0/+6
| |
* | convert build_message to sprintfAaron Patterson2012-01-061-9/+5
| |
* | test response assertionsAaron Patterson2012-01-061-2/+0
| |
* | use assert_includes rather than calling includes? specificallyAaron Patterson2012-01-061-2/+2
| |
* | Revert "remove deprecated API"Aaron Patterson2012-01-051-0/+12
| | | | | | | | This reverts commit f53c247d10acbaacb0d61824cfce888c4b0520d2.
* | remove deprecated APIAaron Patterson2012-01-051-12/+0
| |
* | fix some whitespace errorsAaron Patterson2012-01-051-5/+5
|/
* allow sending documents in AC::TestCase#post and friends.Nick Sutterer2012-01-031-17/+44
|
* escape assigns[:person], assigns[person] etc in actioncontroller testcaseNick Howard2011-12-141-3/+3
|
* Fix bug in assert_template when using only `:layout` optionPrem Sichanugrist2011-12-061-13/+15
| | | | | | | | | | Currently if you're do this: assert_template :layout => "foo" Regardless of what layout you were using, the test will always pass. This was broken since the introduction of :layout option in [d9375f3f]. We have a lot of test cases in actionpack/test/controller/layout_test.rb that use this feature. This will make sure that those test cases are not true negative.
* Merge pull request #3193 from avakhov/patch-ac-test-case-safe-constantizeJosé Valim2011-10-031-3/+1
|\ | | | | use safe_constantize instead constantize in AC::TestCase
| * use safe_constantize instead constantize in AC::TestCaseAlexey Vakhov2011-10-031-3/+1
| |
* | normalize arg for AC::TestCase tests class methodAlexey Vakhov2011-10-031-2/+14
|/
* if ... nil? is more expensive than unlessMilan Dobrota2011-09-041-3/+3
|
* Make ActionController::TestCase#recycle! set @protocol to nilDavid Majda2011-08-231-1/+1
| | | | | | | | | | This ensures that the protocol does not get carried over when there are two or more requests in functional tests. This was a problem when e.g. the first request was HTTP and the second request was HTTPS. Closes #2654. Signed-off-by: Andrew White <andyw@pixeltrix.co.uk>
* Don't modify params in place - fixes #2624Andrew White2011-08-231-5/+3
|
* Fix the issue where default_url_options is being cached on test cases. ↵thoefer2011-08-011-0/+1
| | | | | | Closes #1872. Closes #2031. Signed-off-by: José Valim <jose.valim@gmail.com>
* Call super here to allow SessionHash initialize new stuff for usSantiago Pastorino2011-06-191-1/+1
|
* Add backward compatibility for testing cookiesAndrew White2011-06-051-1/+8
| | | | | | | | | | | | | | | | | | | This commit restores the ability to assign cookies for testing via @request.env['HTTP_COOKIE'] and @request.cookies, e.g: @request.env['HTTP_COOKIE'] = 'user_name=david' get :index assert_equal 'david', cookies[:user_name] and @request.cookies[:user_name] = 'david' get :index assert_equal 'david', cookies[:user_name] Assigning via cookies[] is the preferred method and will take precedence over the other two methods. This is so that cookies set in controller actions have precedence and are carried over between calls to get, post, etc.
* Refactor ActionController::TestCase cookiesAndrew White2011-06-041-13/+8
| | | | | | | | | | | | | | | | | | Assigning cookies for test cases should now use cookies[], e.g: cookies[:email] = 'user@example.com' get :index assert_equal 'user@example.com', cookies[:email] To clear the cookies, use clear, e.g: cookies.clear get :index assert_nil cookies[:email] We now no longer write out HTTP_COOKIE and the cookie jar is persistent between requests so if you need to manipulate the environment for your test you need to do it before the cookie jar is created.
* Merge pull request #1203 from dchelimsky/stringify-parameter-values-in-testsJosé Valim2011-05-281-0/+19
|\ | | | | Stringify param values in controller tests.
| * use to_param (and change method to name accordingly)David Chelimsky2011-05-221-8/+8
| | | | | | | | | | - exclude Rack::Test::UploadedFile to pass existing tests. Are there any other types we're missing?
| * Stringify param values in controller tests.David Chelimsky2011-05-221-0/+19
| | | | | | | | | | | | | | | | This reduces false positives that come from using ints in params in tests, which do not get converted to strings in the tests. In implementations going through rack, they do get converted to strings. - David Chelimsky and Sam Umbach
* | Replace references to ActiveSupport::SecureRandom with just SecureRandom, ↵Jon Leighton2011-05-231-1/+1
|/ | | | and require 'securerandom' from the stdlib when active support is required.
* Use anonymous? that works on both Ruby 1.8 and 1.9.José Valim2011-05-171-3/+4
|
* add more robust test for wrapping params with anonymous classDavid Chelimsky2011-05-171-1/+5
|
* prevent errors when passing a frozen string as a param to ↵misfo2011-04-281-1/+3
| | | | | | | ActionController::TestCase#process since ActionDispatch::Http::Parameters#encode_params will force encoding on all params strings (when using an encoding aware Ruby), dup all strings passed into process. This prevents modification of params passed in and, more importantly, doesn't barf when a frozen string is passed thanks and high fives to kinsteronline
* Improve testing of cookies in functional tests:Andrew White2011-03-061-1/+10
| | | | | | | | | - cookies can be set using string or symbol keys - cookies are preserved across calls to get, post, etc. - cookie names and values are escaped - cookies can be cleared using @request.cookies.clear [#6272 state:resolved]
* class inheritable attributes is used no more! all internal use of class ↵Josh Kalderimis2010-11-201-2/+4
| | | | | | inheritable has been changed to class_attribute. class inheritable attributes has been deprecated. Signed-off-by: José Valim <jose.valim@gmail.com>
* Move @assigns from the controller to the test itselfSantiago Pastorino2010-11-061-0/+1
|
* Fix problems trying to functional test AC::Metal controllersSantiago Pastorino2010-11-061-2/+2
| | | | [#5393 state:committed]
* Reset assert_template instance variables between requests [#5832 state:resolved]Andrew White2010-10-181-0/+7
|
* Solve some warnings and a failing test.José Valim2010-10-031-0/+1
|