aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actionpack/lib/action_view/helpers/form_helper.rb2
-rw-r--r--actionpack/test/template/form_helper_test.rb4
-rw-r--r--activesupport/Rakefile2
-rw-r--r--activesupport/test/core_ext/numeric_ext_test.rb26
4 files changed, 13 insertions, 21 deletions
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb
index 3dae1fc87a..6b6a7edc1d 100644
--- a/actionpack/lib/action_view/helpers/form_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_helper.rb
@@ -433,7 +433,7 @@ module ActionView
builder = instantiate_builder(object_name, object, options)
output = capture(builder, &block)
- html_options[:multipart] = builder.multipart?
+ html_options[:multipart] ||= builder.multipart?
form_tag(options[:url] || {}, html_options) { output }
end
diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb
index 268bab6ad2..dff0b8bdc2 100644
--- a/actionpack/test/template/form_helper_test.rb
+++ b/actionpack/test/template/form_helper_test.rb
@@ -2791,8 +2791,8 @@ class FormHelperTest < ActionView::TestCase
end
def test_form_for_with_html_options_adds_options_to_form_tag
- form_for(@post, html: { id: 'some_form', class: 'some_class' }) do |f| end
- expected = whole_form("/posts/123", "some_form", "some_class", method: "patch")
+ form_for(@post, html: { id: 'some_form', class: 'some_class', multipart: true }) do |f| end
+ expected = whole_form("/posts/123", "some_form", "some_class", method: "patch", multipart: "multipart/form-data")
assert_dom_equal expected, output_buffer
end
diff --git a/activesupport/Rakefile b/activesupport/Rakefile
index 822c9d98ae..e3788ed54f 100644
--- a/activesupport/Rakefile
+++ b/activesupport/Rakefile
@@ -15,8 +15,6 @@ namespace :test do
end
end
-# Create compressed packages
-dist_dirs = [ "lib", "test"]
spec = eval(File.read('activesupport.gemspec'))
diff --git a/activesupport/test/core_ext/numeric_ext_test.rb b/activesupport/test/core_ext/numeric_ext_test.rb
index 8c7d00cae1..3744d50864 100644
--- a/activesupport/test/core_ext/numeric_ext_test.rb
+++ b/activesupport/test/core_ext/numeric_ext_test.rb
@@ -153,22 +153,16 @@ end
class NumericExtSizeTest < ActiveSupport::TestCase
def test_unit_in_terms_of_another
- relationships = {
- 1024.bytes => 1.kilobyte,
- 1024.kilobytes => 1.megabyte,
- 3584.0.kilobytes => 3.5.megabytes,
- 3584.0.megabytes => 3.5.gigabytes,
- 1.kilobyte ** 4 => 1.terabyte,
- 1024.kilobytes + 2.megabytes => 3.megabytes,
- 2.gigabytes / 4 => 512.megabytes,
- 256.megabytes * 20 + 5.gigabytes => 10.gigabytes,
- 1.kilobyte ** 5 => 1.petabyte,
- 1.kilobyte ** 6 => 1.exabyte
- }
-
- relationships.each do |left, right|
- assert_equal right, left
- end
+ assert_equal 1024.bytes, 1.kilobyte
+ assert_equal 1024.kilobytes, 1.megabyte
+ assert_equal 3584.0.kilobytes, 3.5.megabytes
+ assert_equal 3584.0.megabytes, 3.5.gigabytes
+ assert_equal 1.kilobyte ** 4, 1.terabyte
+ assert_equal 1024.kilobytes + 2.megabytes, 3.megabytes
+ assert_equal 2.gigabytes / 4, 512.megabytes
+ assert_equal 256.megabytes * 20 + 5.gigabytes, 10.gigabytes
+ assert_equal 1.kilobyte ** 5, 1.petabyte
+ assert_equal 1.kilobyte ** 6, 1.exabyte
end
def test_units_as_bytes_independently