aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext
Commit message (Collapse)AuthorAgeFilesLines
* Return local time for backwards compatibilityAndrew White2013-07-091-8/+25
|
* Retain offset and fraction when using Time.at_with_coercionAndrew White2013-07-091-0/+37
| | | | | | | | | | | | | | | | The standard Ruby behavior for Time.at is to return the same type of time when passing an instance of Time as a single argument. Since the an ActiveSupport::TimeWithZone instance may be a different timezone than the system timezone and DateTime just understands offsets the best we can do is to return an instance of Time with the correct offset. It also maintains the correct fractional second value as well. Fixes #11350. Backports: 484253515c0e05760541dc48946361185c9e6904 1b3873730b96035a238dbff7627bd5942e6dc4e7
* Override Time.at to work with Time-like valuesAndrew White2013-06-081-0/+22
| | | | | | | Time.at allows passing a single Time argument which is then converted to an integer. The conversion code since 1.9.3r429 explicitly checks for an instance of Time so we need to override it to allow DateTime and ActiveSupport::TimeWithZone values.
* Test to allow Range including DateTime and DateTime::Infinitygsphanikumar2013-01-131-0/+6
| | | | Closes #8587
* Merge branch '3-2-sec' into 3-2-secmergeAaron Patterson2013-01-081-6/+22
|\ | | | | | | | | | | | | | | | | | | | | | | | | * 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
| * CVE-2013-0156: Safe XML params parsing. Doesn't allow symbols or yaml.Jeremy Kemper2013-01-081-6/+22
| |
* | Wrap time ranges with timezones, closes #8807Vasiliy Ermolovich2013-01-083-32/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | (cherry picked from commit e2e513621d732abb8efff9120bd9a444836720d6) (cherry picked from commit dcdde7da481e11660634278a8004175a1ce20f39) Backport of #6183, original issue was #6179 Conflicts: activesupport/lib/active_support/core_ext/time/calculations.rb activesupport/test/core_ext/time_ext_test Signed-off-by: Andrew White <andyw@pixeltrix.co.uk>
* | Add :nsec format only for Ruby 1.9Carlos Antonio da Silva2012-12-111-9/+9
| | | | | | | | | | | | Ruby 1.8 does not support this format in Time, so the format will only be added to the available date formats on Ruby 1.9. Changelog entry was changed to explain that as well.
* | Merge pull request #6376 from jgaskins/timestamp-microsecondsJeremy Kemper2012-12-101-1/+3
|/ | | | | | Increase numeric-timestamp precision to nanoseconds Conflicts: activesupport/lib/active_support/core_ext/time/conversions.rb
* Fix AS tests due to builder change with nil values / empty stringsCarlos Antonio da Silva2012-09-071-2/+2
| | | | | Check 0180e090ab6cbe66f7b521a0c03e278a0463accd for more reasoning about that.
* html_escape should escape single quotesSantiago Pastorino2012-08-021-2/+2
| | | | | | | | | | | | 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
* added beginning_of_hour support to core_ext calculations for Time and DateTimeMark J. Titorenko2012-05-043-0/+30
|
* bigdecimal can be duped on Ruby 2.0Aaron Patterson2012-04-101-2/+10
| | | | | | Conflicts: activesupport/test/core_ext/duplicable_test.rb
* add the class name to the assertion messageAaron Patterson2012-04-101-1/+1
|
* Fix some warnings on 3-2-stablekennyj2012-02-211-1/+1
|
* Fixes failing test with ruby 1.8.7-p358Arun Agrawal2012-02-171-2/+2
| | | Same as 91a9b2441783de118a2f9ec11b0aa3ae80133d91
* GH #4883. Optional start_day argument for Time#all_weekkennyj2012-02-051-0/+1
|
* test base64 encode and decodeVijay Dev2012-01-231-0/+9
|
* deprecate ActiveSupport::Base64Sergey Nartimov2012-01-031-2/+4
| | | | extend and define ::Base64 if needed
* refactor Range#include? to handle ranges with floatsSergey Nartimov2011-12-301-0/+4
| | | | | | Conflicts: activesupport/lib/active_support/core_ext/range/include_range.rb
* Revert "Added Enumerable#pluck to wrap the common pattern of ↵Aaron Patterson2011-12-221-8/+1
| | | | | | collect(&:method) *DHH*" This reverts commit 4d20de8a50d889a09e6f5642984775fe796ca943.
* Overrode Hash#nested_under_indifferent_access in HashWithIndifferentAccessMiles Georgi2011-12-111-0/+3
| | | | to return self.
* Restore performance of ERB::Util.html_escapeJon Jensen2011-12-031-6/+17
| | | | | | | Revert html_escape to do a single gsub again, but add the "n" flag (no language, i.e. not multi-byte) to protect against XSS via invalid utf8 Signed-off-by: José Valim <jose.valim@gmail.com>
* Added Enumerable#pluck to wrap the common pattern of collect(&:method) *DHH*David Heinemeier Hansson2011-12-021-1/+8
|
* Module#synchronize is deprecated with no replacement. Please use `monitor` ↵Aaron Patterson2011-11-291-89/+0
| | | | from ruby's standard library.
* Merge pull request #3767 from tadast/object_inYehuda Katz2011-11-261-0/+10
|\ | | | | Object#in? also accepts multiple parameters
| * Object#in? also accepts multiple parametersTadas Tamošauskas2011-11-261-0/+10
| |
* | add more tests for monday and sunday methodsVijay Dev2011-11-261-0/+2
| |
* | Tests added for monday and sunday Arun Agrawal2011-11-261-0/+8
| | | | | | | | | | Reference commits : a8f2860d0e7db86c61bb70935006100b04667ab1 80ac4dc6d0632937ccf61b38bc15fc2f6e27b18b
* | beginning_of_week extended in both Time and Date so that to return week ↵gregolsen2011-11-252-0/+38
| | | | | | | | start based on start day that is monday by default
* | Merge pull request #3725 from marcandre/twz_eqlYehuda Katz2011-11-222-2/+15
|\ \ | |/ |/| Fix inconsistencies with Time{WithZone}#{hash,eql?}
| * Fix inconsistencies with Time{WithZone}#{hash,eql?}Marc-Andre Lafortune2011-11-222-2/+15
| |
* | refactor test_multiple_ofVijay Dev2011-11-161-4/+3
| |
* | Merge pull request #3549 from luckydev/rmethodAaron Patterson2011-11-071-0/+29
|\ \ | | | | | | remove_method tests and changes
| * | added remove_method core_ext testsAnand2011-11-071-0/+29
| |/
* / Removed argument throwing warnings when running tests.Henrik Hodne2011-11-062-16/+16
|/ | | | | | | | The last argument to DateTime.new/civil is the Julian day number for when the calendar reform occured. DateTime ignores it if it's 0, and sets it to the default of DateTime::ITALY instead, so we could just leave it out. This also removes the warnings while running the ActiveSupport tests (there still are some for the setup though).
* defines Module#qualified_const_(defined?|get|set) and String#deconstantizeXavier Noria2011-10-292-0/+98
| | | | | | | | | | This commit also implements a faster version of #demodulize I was unable to isolate with git add --patch. Not a big fan of the name #deconstantize. It complements #demodulize getting rid of the rightmost constant, hence the name, but it is unrelated to the well-known #constantize. So unsure. Could not come with anything better, please feel free to rename.
* Merge pull request #3151 from zenprogrammer/pluralize_without_countJosé Valim2011-10-171-4/+8
|\ | | | | Added include_count parameter to pluralize.
| * Modified String#pluralize to take an optional count parameter.Ryan Oblak2011-09-281-4/+8
| |
* | Fixed test_nonexisting_method_with_arguments to revert commit 29a5aeaYasuo Honda2011-10-061-1/+1
| |
* | Revert "don't raise NoMethodError the tried method doesn't exists"José Valim2011-10-061-1/+1
| | | | | | | | This reverts commit 29a5aeaae976bf8432d57ec996c7c81932a39de6.
* | Merge pull request #2801 from jeremyevans/patch-1Jeremy Kemper2011-10-031-0/+3
|\ \ | |/ |/| Fix obviously breakage of Time.=== for Time subclasses
| * Add tests for fixes to Time.===Jeremy Evans2011-09-071-0/+3
| |
* | Added ActiveSupport::Inflector.safe_constantize and String#safe_constantize; ↵Ryan Oblak2011-09-231-1/+22
| | | | | | | | refactored common constantize tests into ConstantizeTestCases
* | Fix test to reflect use of to_param for keysbrainopia2011-09-181-8/+8
| |
* | Fix Hash#to_query edge case with html_safe string on 1.8 rubybrainopia2011-09-161-0/+9
| |
* | We can't simply check the first line of the backtrace, Arun Agrawal2011-09-041-4/+6
|/ | | because JRuby reports the call to __send__ in the backtrace.
* Revert all the stuff to do with disallowing non-public methods for ↵Jon Leighton2011-08-252-136/+1
| | | | Module#delegate
* Remove trailing whitespaceDaniel Schierbeck2011-08-231-2/+2
|
* properly escape html to avoid invalid utf8 causing XSS attacksAaron Patterson2011-08-161-0/+7
|