Commit Graph

1882 Commits

Author SHA1 Message Date
Carlos Antonio da Silva
363c08fa60 Further simplify enumerable group_by test 2013-04-04 12:36:17 -03:00
Anupam Choudhury
ecdd432f57 Replaced inject with map 2013-04-04 20:36:27 +05:30
Anupam Choudhury
f73140fd47 Removed unused comma after loop variable 2013-04-04 20:36:27 +05:30
Anupam Choudhury
ae984cb1ef Added missing assert 2013-04-02 11:50:25 +05:30
Vipul A M
5a0e583f40 fix some typos in AS 2013-03-30 14:01:42 +05:30
Xavier Noria
341e611547 determine_constant_from_test_name does not swallow NoMethodErrors [Yves Senn] 2013-03-28 10:04:39 +01:00
Rafael Mendonça França
57fbcc5247 Merge pull request #9523 from stopdropandrew/Instrumenter#instrument-yields-payload
ActiveSupport::Notifications::Instrumenter#instrument should yield

Conflicts:
	activesupport/CHANGELOG.md
2013-03-27 17:43:33 -03:00
kennyj
445bc3a200 Fix warning: mismatched indentatmmismatched indentations at 'end' with 'def' 2013-03-19 20:52:20 +09:00
Aaron Patterson
2392535f40 Merge branch 'master-sec'
* master-sec:
  fix protocol checking in sanitization [CVE-2013-1857]
  JDOM XXE Protection [CVE-2013-1856]
  fix incorrect ^$ usage leading to XSS in sanitize_css [CVE-2013-1855]
  stop calling to_sym when building arel nodes [CVE-2013-1854]
2013-03-18 10:17:32 -07:00
Andrew White
341f9a0799 Merge pull request #9774 from senny/9772_reraise_no_method_error_in_proper_context
`TimeWithZone` raises `NoMethodError` in proper context.
2013-03-18 09:49:44 -07:00
Yves Senn
836ea9fb42 TimeWithZone raises NoMethodError in proper context.
Closes #9772.

`TimeWithZone` delegates everything to the wrapped `Time` object
using `method_missing`. The result is that `NoMethodError` error
will be raised in the context of `Time` which leads to a misleading
debug output.
2013-03-18 17:41:34 +01:00
Vipul A M
4bd8ccd984 fix repeat of test; remove unused variable by use of each_key 2013-03-18 19:58:02 +05:30
Carlos Antonio da Silva
28cb11045b Merge pull request #9757 from vipulnsward/remove_message_param
remove unused parameter passed to assert_query_equal method
2013-03-17 08:35:06 -07:00
Vipul A M
b9f7e634ad refactor test to drop unnecessary hash creation, test directly instead 2013-03-17 16:21:33 +05:30
Vipul A M
c7ea42c244 remove unused parameter passed to assert_query_equal method 2013-03-17 15:15:00 +05:30
Steve Klabnik
feaa6e2048 Revert "Merge pull request #8156 from fredwu/acronym_fix-master"
This reverts commit 867dc1700f32aae6f98c4651bd501597e6b52bc0, reversing
changes made to 9a421aaa8285cf2a7ecb1af370748b0337818930.

This breaks anyone who's using ForceSSL: https://travis-ci.org/rails-api/rails-api/jobs/5556065

Please see comments on #8156 for some discussion.
2013-03-16 15:25:49 -07:00
Fred Wu
515feb1fd6 Fixed a bug where the inflector would replace camelCase strings and disregarding specified acronyms, fixes #8015 2013-03-17 00:31:00 +11:00
Ben Murphy
db8b636e50 JDOM XXE Protection [CVE-2013-1856] 2013-03-15 17:46:15 -07:00
Steve Klabnik
1a9055073d Revert "make new rails apps log to STDOUT"
This reverts commit b7d9d6e2cd5082d269dafbc0316e2107febe1451.

Per discussion with @jeremy and @rubys on Campfire.
2013-03-15 10:38:00 -07:00
Terence Lee
b7d9d6e2cd make new rails apps log to STDOUT 2013-03-15 10:05:10 -07:00
Andrew White
dff86e6ea0 Add regression tests for #9678
The bug with `ActiveSupport::TimeZone.parse` described in #9678 was
unwittingly fixed in 005d910 so add some tests to prevent regression.
2013-03-13 05:46:34 +00:00
Carlos Antonio da Silva
466ff9310a Merge pull request #9681 from vipulnsward/fix_typo_in_module_name
Fix typo in DependenciesTestHelpers module name
2013-03-12 03:55:30 -07:00
Vipul A M
8778e1c4af Fix typo in DependenciesTestHelpers module name 2013-03-12 10:33:32 +05:30
Vipul A M
647a9abb02 Cleanup tests for unused variables 2013-03-11 16:03:10 +05:30
Paul Nikitochkin
20ae0d0e39 Fixed tests for returning an instance of Time in the local system timezone. 2013-03-10 23:57:11 +02:00
stopdropandrew
a007800a55 ActiveSupport::Notifications::Instrumenter#instrument should yield
its payload the same way that ActiveSupport::Notifications does.
Fix spelling in test name.
2013-03-02 16:05:05 -08:00
Charles Jones
b8837066dc Fix deletion of empty directories:
1. When comparing the directory to delete against the top level
   cache_path, use File.realpath to make sure we aren't comparing two
   unequal strings that point to the same path. This occurs, for
   example, when cache_path has a trailing slash, which it does in the
   default Rails configuration. Since the input to
   delete_empty_directories never has a trailing slash, the comparison
   will never be true and the top level cache directory (and above) may
   be deleted. However…

2. File.delete raises EPERM when trying to delete a directory, so no
   directories have ever been deleted. Changing the code to Dir.delete
   fixes that.
2013-02-25 18:54:44 -06:00
Chris Baynes
fa891a2b9d Keep second fraction when DateTime#change is called. 2013-02-25 11:05:49 +01:00
stopdropandrew
cb100ca02b Added ActiveSupport::TimeWithZone#to_r for Time#at compatibility. 2013-02-24 13:24:50 -08:00
Carlos Antonio da Silva
38f347a825 Move number_to_human test from AP to AS
Since all changes from #9347 are related to AS, it seems proper that the
test is placed there as well.
2013-02-22 19:44:50 -03:00
Gagan Awhad
6f380d3778 Added beginning_of_minute support to core_ext calculations for Time and DateTime 2013-02-21 16:14:16 -06:00
Beyond
d59a877da4 added compress options for gzip
added test for compress options of gzip

update changelog
2013-02-10 20:01:42 +09:00
Jeremy Kemper
c7598134a4 Merge pull request #9128 from jamesotron/iso8601-sub-second-accuracy
Modify TimeWithZone#as_json to return 3DP of sub-second accuracy.
2013-02-06 12:33:28 -08:00
Akira Matsuda
9ec14c223b Missing require extract_options 2013-01-31 15:56:47 +09:00
James Harton
28ab79d7c5 Modify TimeWithZone#as_json to return 3DP of sub-second accuracy by default, since it's allowed by the spec and is very useful. 2013-01-31 14:11:51 +13:00
Xavier Noria
30034dfbc4 Merge pull request #8830 from antoinelyset/master
Improve String#squish whitespaces matching
2013-01-28 13:24:56 -08:00
Akira Matsuda
5f30b547c8 Use Encoding::UTF_8 constant 🚯 2013-01-28 17:06:02 +09:00
Akira Matsuda + Koichi Sasada
b7b27fc2a3 Set Thread.abort_on_exception for the whole AS, AP, and AR tests
this would give us some more clues in case a test silently dies inside Thread
2013-01-24 20:00:45 +09:00
Akira Matsuda
9b0f3faab4 Fix some wrong String extensions tests
* ASCII_STRING was not an ASCII String
* BYTE_STRING was not an in valid UTF-8 String
* added an assertion for non-UTF-8 String
2013-01-23 13:30:55 +09:00
Akira Matsuda
389ae055ae Test String#dasherize 2013-01-23 13:29:40 +09:00
Akira Matsuda
740d363890 Test that rescue_from accepts a class name in String 2013-01-23 13:29:40 +09:00
Akira Matsuda
ffd0dd31f8 Test Kernel#quietly 2013-01-23 13:29:40 +09:00
Akira Matsuda
36ff09d7da Test try! with a block 2013-01-23 13:29:40 +09:00
Akira Matsuda
ce0f977ae9 Test that DeprecatedConstantProxy does not warn when accessing its class 2013-01-23 13:29:40 +09:00
Akira Matsuda
4c5c98d0d3 Missing AS::Deprecation::DeprecatedObjectProxy test 2013-01-23 13:29:40 +09:00
Akira Matsuda
6343227bb0 Test that a DateTime acts_like_date 2013-01-23 13:29:40 +09:00
Antoine Lyset
b5245da94a Improve String#squish whitespaces matching 2013-01-22 22:46:11 +01:00
Xavier Noria
3f18f73c20 Merge pull request #8671 from xuanxu/fix_irregular
Inflector irregular singularize rules
2013-01-21 08:06:26 -08:00
Andrew White
ee3458217b Use DateTime.parse inside String#to_datetime
Use the standard library's `DateTime.parse` because it's marginally
faster and supports partial date/time strings.

Benchmark:
       user     system      total        real
old  3.980000   0.000000   3.980000 (  3.987606)
new  3.640000   0.010000   3.650000 (  3.641342)
2013-01-21 12:33:49 +00:00
Andrew White
b79adc4323 Standardise the return value of to_time
This commit standardises the return value of `to_time` to an instance
of `Time` in the local system timezone, matching the Ruby core and
standard library behavior.

The default form for `String#to_time` has been changed from :utc to
:local but research seems to suggest the latter is the more common form.

Also fix an edge condition with `String#to_time` where the string has
a timezone offset in it and the mode is :local. e.g:

  # Before:
  >> "2000-01-01 00:00:00 -0500".to_time(:local)
  => 2000-01-01 05:00:00 -0500

  # After:
  >> "2000-01-01 00:00:00 -0500".to_time(:local)
  => 2000-01-01 00:00:00 -0500

Closes #2453
2013-01-21 12:33:49 +00:00