fixing issue with rails 3.0

Oleg committed Sep 28, 2011
commit 39c582a67e4d873f07dcdd7c235822f9add4ccad
Showing 3 changed files with 3 additions and 2 deletions
app/models/cms/block.rb +1 -1
@@ @@ -37,7 +37,7 @@ protected
temp_files.each do |file|
self.files.collect{|f| f.mark_for_destruction } if single_file
- self.files.new(:site => self.page.site, :file => file)
+ self.files.build(:site => self.page.site, :file => file)
end
self.content = nil unless self.content.is_a?(String)
end
test/test_helper.rb +1 -0
@@ @@ -6,6 +6,7 @@ require 'rails/test_help'
class ActiveSupport::TestCase
+ # Shut the fuck up
$stdout_orig = $stdout
$stderr_orig = $stderr
$stdout = StringIO.new
test/unit/models/block_test.rb +1 -1
@@ @@ -79,7 +79,7 @@ class CmsBlockTest < ActiveSupport::TestCase
block = page.blocks.first
assert_equal 'file', block.label
assert_equal nil, block.content
- assert_equal 1, block.files.count, 'huh'
+ assert_equal 1, block.files.count
assert_equal 'valid_image.jpg', block.files.first.file_file_name
end