| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
| |
|
|\
| |
| |
| |
| | |
willbryant/flash_must_not_load_session_on_every_request_master
Fix the Flash middleware loading the session on every request
|
| |
| |
| |
| | |
dangerous especially with Rack::Cache), it should only be loaded when the flash method is called
|
| | |
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
| |
headers (and its causing problems for Strong Parameters attempt of wrapping request.parameters because it will change in testing)
|
|
|
|
|
|
| |
This method has no effect since exception handling was
moved to middlewares and ActionController tests do not
use any middlewares.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|\ |
|
| | |
|
| | |
|
| | |
|
|\ \
| | |
| | | |
Test unit cleanup
|
| | | |
|
|/ /
| |
| |
| |
| | |
- instance_variables return symbols in 1.9
- there is instance_variable_defined? method
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
This reverts commit f53c247d10acbaacb0d61824cfce888c4b0520d2.
|
| | |
|
|/ |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
use safe_constantize instead constantize in AC::TestCase
|
| | |
|
|/ |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
| |
Closes #1872. Closes #2031.
Signed-off-by: José Valim <jose.valim@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
Stringify param values in controller tests.
|
| |
| |
| |
| |
| | |
- exclude Rack::Test::UploadedFile to pass existing tests. Are there any
other types we're missing?
|
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|/
|
|
| |
and require 'securerandom' from the stdlib when active support is required.
|
| |
|
| |
|