10305 Commits

Author SHA1 Message Date
Yehuda Katz
fdf356d74b Fixed HTTP digest to properly return 401 when the Authorization header has no nonce specified, or the Authorization header specifies Basic auth [#2968 state:resolved] 2009-10-21 12:04:59 -07:00
Mike Gunderloy
9edfdef2a7 Fix bad assumption in BacktraceCleaner test [#3249 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-10-18 17:23:28 -02:00
Travis Briggs
eb30c69544 Ensure number_to_human_size does not strip zeros from the end [#1763 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-10-17 13:37:46 +13:00
Michael Koziarski
459749c30c Backport the xss_safe? method for plugin authors targetting 2.3 and master 2009-10-15 17:19:24 +13:00
George Ogata
e10b0ddc7b Make IntegrationTest::Runner propagate method_missing to ancestors.
Fixes RSpec integration example groups, which mixes its Matchers
module into ActiveSupport::TestCase.

Signed-off-by: Michael Koziarski <michael@koziarski.com>
2009-10-15 11:02:02 +13:00
Jeffrey Hardy
bbaf3a04f5 CookieJar#delete should return the key's value, consistent with a Hash
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-10-14 11:51:11 -07:00
Jeremy Kemper
7454d1874c Mark html safety 2009-10-09 18:37:38 -07:00
Pratik Naik
c23706b787 Add a :limit option to specify the maximum number of records that can be processed by accepts_nested_attributes_for
Conflicts:

	activerecord/lib/active_record/nested_attributes.rb
2009-10-09 16:11:22 +01:00
Pratik Naik
4010b49de8 Store entire options hash in the class var rather than just the reject_if proc for the nested attributes
Conflicts:

	activerecord/lib/active_record/nested_attributes.rb
	activerecord/test/cases/nested_attributes_test.rb
2009-10-09 15:47:31 +01:00
Pratik Naik
c47c5af1c8 Mute log info coming from the local_cache strategy 2009-10-09 15:12:01 +01:00
Pratik Naik
48b30608a4 Ensure MessageVerifier raises appropriate exception on tampered data 2009-10-09 02:26:37 +01:00
Michael Koziarski
95b7e4f7d7 field_error_proc needs to return a safe string 2009-10-08 14:02:12 +13:00
Michael Koziarski
80da8eb43d Merge the prerequisites for on-by-default XSS escaping into rails.
This consists of:

* String#html_safe! a method to mark a string as 'safe'
* ActionView::SafeBuffer a string subclass which escapes anything unsafe which is concatenated to it
* Calls to String#html_safe! throughout the rails helpers
* a 'raw' helper which lets you concatenate trusted HTML from non-safety-aware sources (e.g. presantized strings in the DB)

Note, this does *not* give you on-by-default XSS escaping in 2.3 applications.  To get that you'll need to install a plugin:

http://github.com/nzkoz/rails_xss
2009-10-08 13:59:21 +13:00
Pratik Naik
a69316b293 Use indifferent access attributes instead of stringifying them 2009-10-08 00:14:52 +01:00
Pratik Naik
e2127991a1 Allow accepts_nested_attributes_for :reject_if option accept symbols for using a method 2009-10-07 23:45:40 +01:00
pivotal
6f2c4991ef Explicitly require ActionController's CGI extensions so they're properly loaded before the first request.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
2009-10-08 09:56:23 +13:00
Bryan Helmkamp
0f14d7b6d3 Only load rake tasks from tasks/**/*.rake and lib/tasks/**/*.rake in plugins
Previously, it was **/tasks/**/*.rake, and that loaded some paths that shouldn't be like:

  * vendor/plugins/admin_assistant/test_rails_app/lib/tasks/rspec.rake
  * vendor/plugins/will_paginate/test/tasks.rake

Signed-off-by: Michael Koziarski <michael@koziarski.com>
2009-10-08 09:53:33 +13:00
Jesse Proudman
58f14438a9 Running rake dev leaves ERB in environment.rb. The existing Rake task was just copying the file across. This patch modifies the Rake task to use the same ERB processing string used on database.yml, which cleans up the environment.rb file.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
2009-10-07 08:44:59 +13:00
Pratik Naik
91b61a8d16 Monkey patch Rack::Lint to allow string subclass body 2009-10-06 15:55:56 +01:00
Jeffrey Hardy
f98302e46b MessageVerifier#verify raises InvalidSignature if the signature is blank
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-10-05 13:39:10 -07:00
Joshua Peek
11cce5bde9 Coerce all out going body parts to Strings 2009-10-05 14:21:57 -05:00
Bryan Helmkamp
1d7412b135 Reduce specificity of logging test to avoid dependency on the system clock
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-09-29 17:10:01 -07:00
Chad Woolley
1901747001 reduce max size of fixture IDs to fix sqlite2 tests, because sqlite2 was getting negative and changing values for ID field. See http://www.sqlite.org/datatypes.html
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-09-29 02:53:45 -07:00
Chad Woolley
f95a7f896e make mysql and postgresql rebuild databases on every CI build, to prevent breakages such as collation and character set changing
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-09-27 21:57:41 -07:00
Yehuda Katz
26f22a28e9 Merge branch '2-3-stable' of git@github.com:rails/rails into 2-3-stable 2009-09-27 21:57:30 -07:00
John Trupiano
f489b3341c Introduce :almost keyword for distance_of_time_in_words. Make 1.75 days - 2 days return '2 days'.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#3266 state:committed]
2009-09-28 14:56:19 +13:00
Jay Pignata
b372b4c875 Enhancing distance_of_time_in_words to prefix year output with over and about depending upon how many months have elapsed
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#3106 state:committed]
2009-09-28 14:56:14 +13:00
Luciano G Panaro
14a6794a8e Make has_one with :conditions hash scope build or creation of the associated object with those conditions
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#3088 state:committed]
2009-09-28 14:51:14 +13:00
Gaspard Bucher
8371d6f0c1 Fixes a bug where layouts provided with an absolute path would not be found because they were prefixed by 'layouts'. This bug only appears if the path does not contain the word 'layouts'.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#3207 state:committed]
2009-09-28 14:40:21 +13:00
Chad Woolley
4a11ca1c7e include nokogiri gem, so activesupport nokogiri tests run
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-09-26 12:23:18 -05:00
Eloy Duran
b18248ff05 The DomAssertions now also strip surrounding whitespace inside tags. 2009-09-25 17:46:21 +02:00
Eloy Duran
deac481eb7 Made assert_dom_equal and assert_dom_not_equal ignore meaningless whitespace.
Also changed message of assert_dom_equal to be like assert_equal.
2009-09-25 17:05:30 +02:00
Eloy Duran
cddd4746f9 Rewrote ActionView::TestCase.
The test case now mimicks the template environment more closely, so it's
possible to use render, load helper dependencies.

This also fixes assert_select, and similar assertions. Because view tests
and helpers generally don't render full templates assert_select looks
first in rendered and then in output_buffer to find the rendered output.
2009-09-25 15:51:27 +02:00
Manfred Stienstra
c680f2372e Prefix Internet Explorer's accepted mime types with sensible defaults. 2009-09-25 15:47:33 +02:00
Michael Gunderloy
6222ac1a91 Fix variable error in Nokogiri XmlMini code [#3242 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-09-22 00:23:59 +01:00
Aaron Patterson
e18752868a making nokogiri to hash less clever, more fast O_o
[#2243 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-09-17 11:53:09 -07:00
Jeremy Kemper
1488c6cc9e Fix brittle content-type check. [#1956 state:committed] 2009-09-17 11:39:59 -07:00
Justin Bailey
4f5cac53b7 Enable use of MySQL stored procedures by default.
[#3204 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-09-17 10:59:41 -07:00
Developer
179b4512d1 Allow Nokogiri XmlMini backend to process cdata elements
[#3219 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-09-17 10:30:08 -07:00
Jeremy Kemper
ff0377dea5 Fix failing dependencies test relying on . being in LOAD_PATH 2009-09-13 05:44:16 -07:00
Jeremy Kemper
f503a483d4 Extract repetitive method 2009-09-13 05:44:09 -07:00
Jeremy Kemper
abd7bd311a Clean up spurious JSON decoding test failure 2009-09-13 05:43:10 -07:00
Jeremy Kemper
09b197f957 Ruby 1.9 compat: fix regexp slice test 2009-09-13 05:30:59 -07:00
Jeremy Kemper
c6fe042b29 Ruby 1.9: fix Time#beginning_of_day inaccuracy due to subtracting a Float 2009-09-13 05:07:21 -07:00
Jeremy Kemper
8dca666ba1 Silence warning for Encoding.default_external= 2009-09-13 04:49:08 -07:00
Jeremy Kemper
477dfa4c79 Use Encoding.default_external, not _internal 2009-09-13 04:49:02 -07:00
sdsykes
8afeec20e0 Ruby 1.9 compat: corrected instance_methods check
[#3156 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-09-13 02:58:36 -07:00
Michael Koziarski
6ddb7de407 Dup the arguments to string compare so we can use force_encoding.
Conflicts:

	activesupport/lib/active_support/message_verifier.rb
2009-09-13 10:37:41 +12:00
Eloy Duran
2524ac84e6 Removed some superfluous conditionals from the autosave association validation methods.
Which are unneeded now that we only define them when needed.
2009-09-12 15:03:05 +02:00
Alexey Kovyrin
c0245493cb Define autosave association validation methods only when needed. [#3161 state:resolved]
Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com>
2009-09-12 14:55:34 +02:00