Commit Graph

1983 Commits

Author SHA1 Message Date
Greg Ose
e1c7a232ca update FlashHash for 3.2 2014-09-24 12:39:03 -05:00
Charlie Somerville
283923f530 we don't care about deserializing old marshal sessions anymore 2014-09-23 16:41:38 +10:00
Greg Ose
18d37237c4 attribute flash hash test source 2014-09-23 16:22:28 +10:00
Greg Ose
d12475ba60 support old marshalled cookies 2014-09-23 16:22:15 +10:00
Greg Ose
0342deaa22 update flash hash test for 3.0 backport 2014-09-23 16:21:44 +10:00
Greg Ose
91bbe59e17 add flash hash tests 2014-09-23 16:21:37 +10:00
Greg Ose
f0895f838f 📗? Update tests and FlashHash cleanup
* Make FlashHash more like 4.1 (654a2de7a9)
* Move tests to stringified keys (b97e087321)
* Fix tests to properly load / store to session
2014-09-23 16:19:09 +10:00
Rafael Mendonça França
0f3b7d1a31 Only accept actions without File::SEPARATOR in the name.
This will avoid directory traversal in implicit render.

Fixes: CVE-2014-0130
2014-05-05 11:37:34 -03:00
Mack Earnhardt
74e59ea8b6 Backport #5808
df36c5f - Fix assert_template assertion with :layout option
4bd05a7 - Fix assert_template :layout => nil assertion
0d19a08 - Improve assert_template layout checking
2013-03-24 08:16:26 -04:00
Rafael Mendonça França
2c8f349953 Merge pull request #9802 from newsline/fix-broken-action-missing
Fix missing action_missing

Conflicts:
	actionpack/CHANGELOG.md

Conflicts:
	actionpack/test/controller/base_test.rb

Fixes #9799
2013-03-20 18:22:31 -03:00
Juan Barreneche
ce755697fc Extract hardcoded lists to Redo::RestaurantsList 2013-03-14 18:02:20 -03:00
Carlos Antonio da Silva
626d0b157f Do not run this streaming test in Ruby 1.8, fix syntax error 2013-01-17 10:27:38 -02:00
José Valim
a5013bb5af Merge pull request #5288 from lest/patch-2
force response body to be read in assert_template
Conflicts:
	actionpack/lib/action_controller/test_case.rb
2013-01-17 09:25:12 -02:00
Aaron Patterson
48810a52df Merge branch '3-2-sec' into 3-2-secmerge
* 3-2-sec:
  bumping version
  CVE-2013-0156: Safe XML params parsing. Doesn't allow symbols or yaml.
  * Strip nils from collections on JSON and XML posts. [CVE-2013-0155] * dealing with empty hashes. Thanks Damien Mathieu
  Avoid Rack security warning no secret provided

Conflicts:
	actionpack/CHANGELOG.md
	activerecord/CHANGELOG.md
	activesupport/CHANGELOG.md
2013-01-08 11:37:48 -08:00
Jeremy Kemper
43109ecb98 CVE-2013-0156: Safe XML params parsing. Doesn't allow symbols or yaml. 2013-01-08 11:09:50 -08:00
SHIBATA Hiroshi
8a1ba017c6 backport #4f0f1b5 into 3-2-stable. because 1.9.3-p362 warned unused variables.
Conflicts:
	actionpack/test/controller/render_test.rb
2013-01-05 09:38:23 +09:00
Rafael Mendonça França
4d4e6e2f2b Use Ruby 1.8 syntax 2013-01-02 22:52:59 -03:00
Yves Senn
33841a9db3 Backport #8701, do not append a second slash with trailing_slash: true 2013-01-02 22:53:39 +01:00
Carlos Antonio da Silva
5f28000731 Use 1.8 hash style 2012-12-03 21:00:14 -02:00
Jeremy Kemper
9d6e502f81 Override <%== to always behave as literal text rather than toggling based on whether escaping is enabled. Fixes that existing plaintext email templates using <%== unexpectedly flipped to *escaping* HTML when #8235 was merged.
Conflicts:
	actionpack/test/template/template_test.rb
2012-12-03 10:32:23 -07:00
Elia Schito
9c33cb26f4 Accept symbols as #send_data :disposition value 2012-11-27 00:25:55 +01:00
Rafael Mendonça França
d5b275db5c Revert "Merge pull request #7659 from HugoLnx/template_error_no_matches_rebased"
This reverts commit 7d17cd2cbf.

Conflicts:
	actionpack/CHANGELOG.md

Reason: This added a regression since people were relying on this buggy behavior.
This will introduce back #3849 but we will be backward compatible in
stable release.

Fixes #8068.
2012-10-31 00:31:47 -02:00
Rafael Mendonça França
f668ab9adf Use the Ruby 1.8 hash syntax 2012-10-06 19:16:26 -03:00
Rafael Mendonça França
92d761237e Merge pull request #7848 from senny/3415_assert_template_has_nil_variable
can't pass :locals to #assert_template without a view test case (#3415)
Conflicts:
	actionpack/CHANGELOG.md
2012-10-06 16:48:29 -03:00
Rafael Mendonça França
628e38d789 Since File instance doesn't respond to #open use a double to test the
behavior added at c53e5def08
2012-09-30 22:59:23 -03:00
Rafael Mendonça França
7d17cd2cbf Merge pull request #7659 from HugoLnx/template_error_no_matches_rebased
REBASED: fixing assert_template bug when template matches expected, but not ends with
Conflicts:
	actionpack/CHANGELOG.md
	actionpack/lib/action_controller/test_case.rb
2012-09-30 00:18:57 -03:00
Tim Vandecasteele
c53e5def08 Don't paramify ActionDispatch::Http::UploadedFile in tests
To test uploading a file without using fixture_file_upload, a posted
ActionDispatch::Http::UploadedFile should not be paramified (just like
Rack::Test::UploadedFile).
(Rack::Test::UploadedFile and ActionDispatch::Http::UploadedFile don't
share the same API, tempfile is not accessible on
Rack::Test::UploadedFile as discussed in
https://github.com/brynary/rack-test/issues/30)
2012-09-29 16:31:10 +02:00
Yves Senn
dd76b3bbc8 log 404 status when ActiveRecord::RecordNotFound was raised (#7646)
Conflicts:
	actionpack/CHANGELOG.md
	actionpack/lib/action_controller/log_subscriber.rb
2012-09-17 13:39:01 -03:00
Santiago Pastorino
2bdb4ec6ad html_escape should escape single quotes
https://www.owasp.org/index.php/XSS_%28Cross_Site_Scripting%29_Prevention_Cheat_Sheet#RULE_.231_-_HTML_Escape_Before_Inserting_Untrusted_Data_into_HTML_Element_Content
Closes #7215

Conflicts:
	actionpack/test/template/erb_util_test.rb
	actionpack/test/template/form_tag_helper_test.rb
	actionpack/test/template/text_helper_test.rb
	actionpack/test/template/url_helper_test.rb
	activesupport/lib/active_support/core_ext/string/output_safety.rb
2012-08-02 17:09:37 -03:00
Dmitry Vorotilin
ffdca21e44 Show in log correct wrapped keys 2012-07-05 15:47:04 +04:00
Dmitry Vorotilin
4717c2ffc6 Added test for case when view doesn't have logger method when using ActionController::Metal controller. 2012-06-16 00:56:03 +04:00
Aaron Patterson
e7d1849be1 adding a test for #6459 2012-06-14 14:12:14 -07:00
Rafael Mendonça França
f7cde3eb22 Add test to flash sweep after two redirects
This test is needed to avoid regressions in the way that flash works
now (swept in every request).
2012-06-05 16:05:49 -03:00
Piotr Sarnacki
8d4f63a1a5 Include routes.mounted_helpers into integration tests
In integration tests, you might want to use helpers from engines that
you mounted in your application. It's not hard to add it by yourself,
but it's unneeded boilerplate. mounted_helpers are now included by
default. That means that given engine mounted like:

    mount Foo::Engine => "/foo", :as => "foo"

you will be able to use paths from this engine in tests this way:

    foo.root_path #=> "/foo"

(closes #6573)
2012-06-01 16:28:43 +02:00
Andrew White
f3aaac46e6 Refactor the handling of default_url_options in integration tests
This commit improves the handling of default_url_options in integration
tests by making behave closer to how a real application operates.

Specifically the following issues have been addressed:

* Options specified in routes.rb are used (fixes #546)
* Options specified in controllers are used
* Request parameters are recalled correctly
* Tests can override default_url_options directly
2012-05-10 21:12:31 +01:00
Kunal Shah
6f38348265 Add failing test re #3436 which demonstrates content_type is not respected when using the :head method/shortcut 2012-05-07 15:23:06 -04:00
Nick Ragaz
bfb25f9cae Add a role option to wrap_parameters.
The role option identifies which parameters are accessible and should be wrapped. The default role is :default.
2012-05-04 10:14:14 -04:00
Andrew White
d6bbd337ef Don't convert params if the request isn't HTML - fixes #5341
(cherry picked from commit 7a80b69e00f68e673c6ceb5cc684aa9196ed3d9f)

Conflicts:

	actionpack/test/controller/test_test.rb
2012-04-29 10:27:17 +01:00
Rafael Mendonça França
5c7bcfc111 default_url_options does not receive one argument anymore 2012-04-08 23:54:36 -03:00
Santiago Pastorino
13fe1903d8 Remove the leading \n added by textarea on assert_select 2012-03-30 11:44:15 -03:00
Santiago Pastorino
5747e53c92 Set proper rendered_format when doing render :inline
Closes #5632
2012-03-28 18:54:12 -03:00
Piotr Sarnacki
d5980b5f52 Cover one more case in auth_token and remote forms
If embedding auth_token in remote forms is off and we
pass a value for auth_token it should respect it.
2012-03-28 18:09:53 +02:00
Piotr Sarnacki
d646d9d2e7 Added config.action_view.embed_authenticity_token_in_remote_forms
There is a regression introduced in 16ee611fa, which breaks
remote forms that should also work without javascript. This commit
introduces config option that allows to configure this behavior
defaulting to the old behavior (ie. include authenticity token
in remote forms by default)
2012-03-28 14:37:23 +02:00
Piotr Sarnacki
449a4fc095 If partial is rendered in controller, grab format from template
Previously `rendered_format` was set only based on mime types
passed in Accept header, which was wrong if first type from
Accept was different than rendered partial. The fix is to simply
move setting rendered_format to the place where template
is available and grab format from the template. If it fails
we can fallback to formats passed by Accept header.
2012-03-27 05:33:47 +02:00
Arun Agrawal
fcc8743459 Build fix for ruby1.8.7-358 2012-03-19 11:58:55 +05:30
Piotr Sarnacki
7130f91591 Add missing test for #5308 2012-03-17 14:15:55 +01:00
Piotr Sarnacki
1eb6189404 Fix #5440 - multiple render_to_string breaks partials formats
This fixes situation where rendering template to string
sets `rendered_format` to the format rendered there.
This is ok to have consistent formats rendered in partials,
but it breaks on next renders if format is explicitly set
or on last render where default format does not necessarily
need to be the format of first rendered template.
2012-03-17 14:15:50 +01:00
Aaron Patterson
e135ff1afd Merge pull request #5457 from brianmario/typo-fix
Fix typo in redirect test
2012-03-15 15:22:46 -07:00
Aaron Patterson
f52ad6cf33 Merge pull request #5456 from brianmario/redirect-sanitization
Strip null bytes from Location header
2012-03-15 14:58:27 -07:00
Piotr Sarnacki
ccf4ff0360 Remove ActionController::TestCase#rescue_action_in_public!
This method has no effect since exception handling was
moved to middlewares and ActionController tests do not
use any middlewares.
2012-03-15 04:15:41 +01:00