Commit a394c73b by Tom Counsell Committed by Prem Sichanugrist

Test for #947 copying attachments between models should succeed when the attachment is empty

parent 813c8c8f
...@@ -640,4 +640,21 @@ class IntegrationTest < Test::Unit::TestCase ...@@ -640,4 +640,21 @@ class IntegrationTest < Test::Unit::TestCase
end end
end end
end end
context "Copying attachment between models" do
setup do
rebuild_model
@file = File.new(fixture_file("5k.png"), 'rb')
end
teardown { @file.close }
should "should succeed when attachment is empty" do
original = Dummy.create!
copy = Dummy.new
copy.avatar = original.avatar
copy.save
assert !copy.avatar.present?
end
end
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment