Permalink
Browse files

Merge commit 'mainstream/master'

Conflicts:
	railties/guides/files/javascripts/code_highlighter.js
	railties/guides/files/javascripts/guides.js
	railties/guides/files/javascripts/highlighters.js
	railties/guides/files/stylesheets/main.css
	railties/guides/files/stylesheets/print.css
	railties/guides/files/stylesheets/reset.css
	railties/guides/files/stylesheets/style.css
	railties/guides/files/stylesheets/syntax.css
	railties/guides/rails_guides/indexer.rb
	railties/guides/source/2_2_release_notes.textile
	railties/guides/source/2_3_release_notes.textile
	railties/guides/source/action_controller_overview.textile
	railties/guides/source/action_mailer_basics.textile
	railties/guides/source/active_record_basics.textile
	railties/guides/source/activerecord_validations_callbacks.textile
	railties/guides/source/association_basics.textile
	railties/guides/source/caching_with_rails.textile
	railties/guides/source/command_line.textile
	railties/guides/source/debugging_rails_applications.textile
	railties/guides/source/form_helpers.textile
	railties/guides/source/getting_started.textile
	railties/guides/source/i18n.textile
	railties/guides/source/layout.html.erb
	railties/guides/source/layouts_and_rendering.textile
	railties/guides/source/migrations.textile
	railties/guides/source/performance_testing.textile
	railties/guides/source/plugins.textile
	railties/guides/source/rails_on_rack.textile
	railties/guides/source/routing.textile
	railties/guides/source/security.textile
	railties/guides/source/testing.textile
  • Loading branch information...
2 parents 9761239 + 96d6105 commit b9ba2fe55059a6d9f141d1d502e16bdfd46f26cb @lifo lifo committed Feb 6, 2009
Showing with 4,483 additions and 4,419 deletions.
  1. +5 −0 actionmailer/CHANGELOG
  2. +1 −1 actionmailer/lib/action_mailer/base.rb
  3. +4 −8 actionmailer/test/abstract_unit.rb
  4. +1 −4 actionmailer/test/mail_service_test.rb
  5. +2 −0 actionpack/CHANGELOG
  6. +1 −1 actionpack/lib/action_controller/layout.rb
  7. +2 −1 actionpack/lib/action_view/helpers/asset_tag_helper.rb
  8. +1 −1 actionpack/lib/action_view/helpers/atom_feed_helper.rb
  9. +2 −1 actionpack/lib/action_view/helpers/form_helper.rb
  10. +25 −2 actionpack/lib/action_view/helpers/url_helper.rb
  11. +5 −1 actionpack/lib/action_view/paths.rb
  12. +1 −5 actionpack/test/abstract_unit.rb
  13. +10 −14 actionpack/test/controller/caching_test.rb
  14. +0 −4 actionpack/test/controller/dispatcher_test.rb
  15. +0 −4 actionpack/test/controller/integration_test.rb
  16. +152 −154 actionpack/test/controller/polymorphic_routes_test.rb
  17. +10 −1 actionpack/test/controller/render_test.rb
  18. +0 −3 actionpack/test/controller/rescue_test.rb
  19. +1,392 −1,394 actionpack/test/controller/routing_test.rb
  20. +1 −0 actionpack/test/fixtures/test/render_implicit_js_template_without_layout.js.erb
  21. +31 −33 actionpack/test/template/active_record_helper_i18n_test.rb
  22. +12 −14 actionpack/test/template/asset_tag_helper_test.rb
  23. +66 −68 actionpack/test/template/compiled_templates_test.rb
  24. +86 −90 actionpack/test/template/date_helper_i18n_test.rb
  25. +32 −34 actionpack/test/template/date_helper_test.rb
  26. +9 −0 actionpack/test/template/form_helper_test.rb
  27. +598 −600 actionpack/test/template/form_options_helper_test.rb
  28. +53 −55 actionpack/test/template/number_helper_i18n_test.rb
  29. +4 −6 actionpack/test/template/test_test.rb
  30. +17 −19 actionpack/test/template/translation_helper_test.rb
  31. +34 −1 actionpack/test/template/url_helper_test.rb
  32. +5 −0 activerecord/CHANGELOG
  33. +1 −0 activerecord/lib/active_record/attribute_methods.rb
  34. +12 −0 activerecord/lib/active_record/autosave_association.rb
  35. +14 −8 activerecord/lib/active_record/base.rb
  36. +1 −0 activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
  37. +6 −2 activerecord/lib/active_record/nested_attributes.rb
  38. +1 −1 activerecord/lib/active_record/session_store.rb
  39. +1 −1 activerecord/lib/active_record/validations.rb
  40. +4 −6 activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb
  41. +4 −6 activerecord/test/cases/associations/has_many_associations_test.rb
  42. +4 −6 activerecord/test/cases/associations/has_many_through_associations_test.rb
  43. +5 −7 activerecord/test/cases/associations/join_model_test.rb
  44. +12 −0 activerecord/test/cases/attribute_methods_test.rb
  45. +23 −1 activerecord/test/cases/autosave_association_test.rb
  46. +17 −19 activerecord/test/cases/calculations_test.rb
  47. +1 −0 activerecord/test/cases/datatype_test_postgresql.rb
  48. +26 −13 activerecord/test/cases/finder_test.rb
  49. +13 −17 activerecord/test/cases/fixtures_test.rb
  50. +4 −9 activerecord/test/cases/helper.rb
  51. +208 −216 activerecord/test/cases/migration_test.rb
  52. +14 −0 activerecord/test/cases/nested_attributes_test.rb
  53. +0 −4 activerecord/test/cases/query_cache_test.rb
  54. +14 −18 activerecord/test/cases/transactions_test.rb
  55. +287 −293 activerecord/test/cases/validations_i18n_test.rb
  56. +4 −8 activeresource/test/abstract_unit.rb
  57. +13 −15 activeresource/test/connection_test.rb
  58. +1 −1 activesupport/lib/active_support/inflector.rb
  59. +2 −0 activesupport/lib/active_support/multibyte/chars.rb
  60. +2 −1 activesupport/test/abstract_unit.rb
  61. +2 −2 ci/ci_build.rb
  62. +1 −1 ci/geminstaller.yml
  63. +188 −188 railties/guides/files/javascripts/code_highlighter.js
  64. +8 −8 railties/guides/files/javascripts/guides.js
  65. +2 −2 railties/guides/files/javascripts/highlighters.js
  66. +12 −12 railties/guides/files/stylesheets/main.css
  67. +52 −52 railties/guides/files/stylesheets/print.css
  68. +43 −43 railties/guides/files/stylesheets/reset.css
  69. +13 −13 railties/guides/files/stylesheets/style.css
  70. +2 −2 railties/guides/files/stylesheets/syntax.css
  71. +1 −1 railties/guides/rails_guides/indexer.rb
  72. +5 −5 railties/guides/source/2_2_release_notes.textile
  73. +42 −42 railties/guides/source/2_3_release_notes.textile
  74. +3 −3 railties/guides/source/action_controller_overview.textile
  75. +14 −14 railties/guides/source/action_mailer_basics.textile
  76. +4 −4 railties/guides/source/active_record_basics.textile
  77. +49 −49 railties/guides/source/activerecord_validations_callbacks.textile
  78. +33 −33 railties/guides/source/association_basics.textile
  79. +12 −12 railties/guides/source/caching_with_rails.textile
  80. +11 −11 railties/guides/source/command_line.textile
  81. +8 −8 railties/guides/source/debugging_rails_applications.textile
  82. +8 −8 railties/guides/source/form_helpers.textile
  83. +20 −20 railties/guides/source/getting_started.textile
  84. +16 −16 railties/guides/source/i18n.textile
  85. +3 −3 railties/guides/source/layout.html.erb
  86. +10 −10 railties/guides/source/layouts_and_rendering.textile
  87. +11 −11 railties/guides/source/migrations.textile
  88. +6 −6 railties/guides/source/performance_testing.textile
  89. +38 −38 railties/guides/source/plugins.textile
  90. +2 −2 railties/guides/source/rails_on_rack.textile
  91. +13 −13 railties/guides/source/routing.textile
  92. +5 −5 railties/guides/source/security.textile
  93. +36 −36 railties/guides/source/testing.textile
  94. +15 −4 railties/lib/commands/server.rb
  95. +2 −2 railties/lib/initializer.rb
  96. +1 −1 railties/lib/rails_generator/generators/components/scaffold/templates/controller.rb
  97. +1 −1 railties/lib/rails_generator/generators/components/scaffold/templates/layout.html.erb
  98. +2 −2 railties/lib/rails_generator/generators/components/scaffold/templates/view_edit.html.erb
  99. +2 −2 railties/lib/rails_generator/generators/components/scaffold/templates/view_index.html.erb
  100. +2 −2 railties/lib/rails_generator/generators/components/scaffold/templates/view_new.html.erb
  101. +1 −1 railties/lib/rails_generator/generators/components/scaffold/templates/view_show.html.erb
  102. +1 −0 railties/lib/tasks/databases.rake
  103. +5 −7 railties/test/abstract_unit.rb
  104. +0 −5 railties/test/boot_test.rb
  105. +10 −12 railties/test/console_app_test.rb
  106. +114 −116 railties/test/gem_dependency_test.rb
  107. +11 −13 railties/test/generators/rails_scaffold_generator_test.rb
  108. +204 −212 railties/test/initializer_test.rb
  109. +50 −57 railties/test/plugin_locator_test.rb
  110. +133 −138 railties/test/plugin_test.rb
View
@@ -1,3 +1,8 @@
+*Edge*
+
+* Fixed that ActionMailer should send correctly formatted Return-Path in MAIL FROM for SMTP #1842 [Matt Jones]
+
+
*2.3.0 [RC1] (February 1st, 2009)*
* Fixed RFC-2045 quoted-printable bug #1421 [squadette]
@@ -672,7 +672,7 @@ def create_mail
def perform_delivery_smtp(mail)
destinations = mail.destinations
mail.ready_to_send
- sender = mail['return-path'] || mail.from
+ sender = (mail['return-path'] && mail['return-path'].spec) || mail.from
smtp = Net::SMTP.new(smtp_settings[:address], smtp_settings[:port])
smtp.enable_starttls_auto if smtp_settings[:enable_starttls_auto] && smtp.respond_to?(:enable_starttls_auto)
@@ -1,5 +1,9 @@
+require 'rubygems'
require 'test/unit'
+gem 'mocha', '>= 0.9.5'
+require 'mocha'
+
$:.unshift "#{File.dirname(__FILE__)}/../lib"
$:.unshift "#{File.dirname(__FILE__)}/../../activesupport/lib"
$:.unshift "#{File.dirname(__FILE__)}/../../actionpack/lib"
@@ -43,21 +47,13 @@ def self.new(*args)
end
def uses_gem(gem_name, test_name, version = '> 0')
- require 'rubygems'
gem gem_name.to_s, version
require gem_name.to_s
yield
rescue LoadError
$stderr.puts "Skipping #{test_name} tests. `gem install #{gem_name}` and try again."
end
-# Wrap tests that use Mocha and skip if unavailable.
-unless defined? uses_mocha
- def uses_mocha(test_name, &block)
- uses_gem('mocha', test_name, '>= 0.5.5', &block)
- end
-end
-
def set_delivery_method(delivery_method)
@old_delivery_method = ActionMailer::Base.delivery_method
ActionMailer::Base.delivery_method = delivery_method
@@ -289,8 +289,6 @@ def receive(mail)
end
end
-uses_mocha 'ActionMailerTest' do
-
class ActionMailerTest < Test::Unit::TestCase
include ActionMailer::Quoting
@@ -940,6 +938,7 @@ def test_return_path_with_deliver
ActionMailer::Base.delivery_method = :smtp
TestMailer.deliver_return_path
assert_match %r{^Return-Path: <another@somewhere.test>}, MockSMTP.deliveries[0][0]
+ assert_equal "another@somewhere.test", MockSMTP.deliveries[0][1].to_s
end
def test_body_is_stored_as_an_ivar
@@ -974,8 +973,6 @@ def test_starttls_is_not_enabled
end
end
-end # uses_mocha
-
class InheritableTemplateRootTest < Test::Unit::TestCase
def test_attr
expected = "#{File.dirname(__FILE__)}/fixtures/path.with.dots"
View
@@ -1,5 +1,7 @@
*Edge*
+* Fix a syntax error in current_page?() that was prevent matches against URL's with multiple query parameters #1385, #1868 [chris finne/Andrew White]
+
* Added localized rescue template when I18n.locale is set (ex: public/404.da.html) #1835 [José Valim]
@@ -173,7 +173,7 @@ def layout_conditions #:nodoc:
end
def default_layout(format) #:nodoc:
- layout = read_inheritable_attribute(:layout)
+ layout = read_inheritable_attribute(:layout) unless format == :js
return layout unless read_inheritable_attribute(:auto_layout)
find_layout(layout, format)
end
@@ -516,7 +516,8 @@ def self.cache_asset_timestamps=(value)
def compute_public_path(source, dir, ext = nil, include_host = true)
has_request = @controller.respond_to?(:request)
- if ext && (File.extname(source).blank? || File.exist?(File.join(ASSETS_DIR, dir, "#{source}.#{ext}")))
+ source_ext = File.extname(source)[1..-1]
+ if ext && (source_ext.blank? || (ext != source_ext && File.exist?(File.join(ASSETS_DIR, dir, "#{source}.#{ext}"))))
source += ".#{ext}"
end
@@ -30,7 +30,7 @@ module AtomFeedHelper
# app/views/posts/index.atom.builder:
# atom_feed do |feed|
# feed.title("My great blog!")
- # feed.updated((@posts.first.created_at))
+ # feed.updated(@posts.first.created_at)
#
# for post in @posts
# feed.entry(post) do |entry|
@@ -971,7 +971,8 @@ def fields_for_with_nested_attributes(association_name, args, block)
@template.fields_for(child_name, child, *args, &block)
end.join
else
- @template.fields_for(name, association, *args, &block)
+ object = args.first.respond_to?(:new_record?) ? args.first : association
+ @template.fields_for(name, object, *args, &block)
end
end
@@ -507,7 +507,30 @@ def mail_to(email_address, name = nil, html_options = {})
# current_page?(:controller => 'shop', :action => 'checkout')
# # => true
#
- # current_page?(:controller => 'shop', :action => 'checkout', :order => 'asc)
+ # current_page?(:controller => 'shop', :action => 'checkout', :order => 'asc')
+ # # => false
+ #
+ # current_page?(:action => 'checkout')
+ # # => true
+ #
+ # current_page?(:controller => 'library', :action => 'checkout')
+ # # => false
+ #
+ # Let's say we're in the <tt>/shop/checkout?order=desc&page=1</tt> action.
+ #
+ # current_page?(:action => 'process')
+ # # => false
+ #
+ # current_page?(:controller => 'shop', :action => 'checkout')
+ # # => true
+ #
+ # current_page?(:controller => 'shop', :action => 'checkout', :order => 'desc', :page=>'1')
+ # # => true
+ #
+ # current_page?(:controller => 'shop', :action => 'checkout', :order => 'desc', :page=>'2')
+ # # => false
+ #
+ # current_page?(:controller => 'shop', :action => 'checkout', :order => 'desc')
# # => false
#
# current_page?(:action => 'checkout')
@@ -516,7 +539,7 @@ def mail_to(email_address, name = nil, html_options = {})
# current_page?(:controller => 'library', :action => 'checkout')
# # => false
def current_page?(options)
- url_string = CGI.escapeHTML(url_for(options))
+ url_string = CGI.unescapeHTML(url_for(options))
request = @controller.request
# We ignore any extra parameters in the request_uri if the
# submitted url doesn't have any either. This lets the function
@@ -2,7 +2,11 @@ module ActionView #:nodoc:
class PathSet < Array #:nodoc:
def self.type_cast(obj)
if obj.is_a?(String)
- Template::EagerPath.new(obj)
+ if !Object.const_defined?(:Rails) || Rails.configuration.cache_classes
+ Template::EagerPath.new(obj)
+ else
+ Template::Path.new(obj)
+ end
else
obj
end
@@ -8,7 +8,7 @@
require 'stringio'
require 'test/unit'
-gem 'mocha', '>= 0.9.3'
+gem 'mocha', '>= 0.9.5'
require 'mocha'
begin
@@ -38,7 +38,3 @@
FIXTURE_LOAD_PATH = File.join(File.dirname(__FILE__), 'fixtures')
ActionController::Base.view_paths = FIXTURE_LOAD_PATH
-
-def uses_mocha(test_name)
- yield
-end
@@ -108,13 +108,11 @@ def test_should_cache_with_trailing_slash_on_url
assert File.exist?("#{FILE_STORE_PATH}/page_caching_test/trailing_slash.html")
end
- uses_mocha("should_cache_ok_at_custom_path") do
- def test_should_cache_ok_at_custom_path
- @request.stubs(:path).returns("/index.html")
- get :ok
- assert_response :ok
- assert File.exist?("#{FILE_STORE_PATH}/index.html")
- end
+ def test_should_cache_ok_at_custom_path
+ @request.stubs(:path).returns("/index.html")
+ get :ok
+ assert_response :ok
+ assert File.exist?("#{FILE_STORE_PATH}/index.html")
end
[:ok, :no_content, :found, :not_found].each do |status|
@@ -291,13 +289,11 @@ def test_action_cache_conditional_options
ActionController::Base.use_accept_header = old_use_accept_header
end
- uses_mocha 'test action cache' do
- def test_action_cache_with_store_options
- MockTime.expects(:now).returns(12345).once
- @controller.expects(:read_fragment).with('hostname.com/action_caching_test', :expires_in => 1.hour).once
- @controller.expects(:write_fragment).with('hostname.com/action_caching_test', '12345.0', :expires_in => 1.hour).once
- get :index
- end
+ def test_action_cache_with_store_options
+ MockTime.expects(:now).returns(12345).once
+ @controller.expects(:read_fragment).with('hostname.com/action_caching_test', :expires_in => 1.hour).once
+ @controller.expects(:write_fragment).with('hostname.com/action_caching_test', '12345.0', :expires_in => 1.hour).once
+ get :index
end
def test_action_cache_with_custom_cache_path
@@ -1,7 +1,5 @@
require 'abstract_unit'
-uses_mocha 'dispatcher tests' do
-
class DispatcherTest < Test::Unit::TestCase
Dispatcher = ActionController::Dispatcher
@@ -100,5 +98,3 @@ def assert_subclasses(howmany, klass, message = klass.subclasses.inspect)
assert_equal howmany, klass.subclasses.size, message
end
end
-
-end
@@ -1,7 +1,5 @@
require 'abstract_unit'
-uses_mocha 'integration' do
-
class SessionTest < Test::Unit::TestCase
StubApp = lambda { |env|
[200, {"Content-Type" => "text/html", "Content-Length" => "13"}, "Hello, World!"]
@@ -417,5 +415,3 @@ def test_failed_get
assert_equal '', response.body
end
end
-
-end
Oops, something went wrong.

0 comments on commit b9ba2fe

Please sign in to comment.