Commit 7cc0921a by Overbryd Committed by Mike Burns

Added a test for Attachment#uploaded_file

parent 24b0c5ad
......@@ -95,7 +95,7 @@ module Paperclip
uploaded_file = uploaded_file.to_file(:original)
close_uploaded_file = uploaded_file.respond_to?(:close)
else
instance_write(:uploaded_file, uploaded_file)
instance_write(:uploaded_file, uploaded_file) if uploaded_file
end
return nil unless valid_assignment?(uploaded_file)
......
......@@ -855,6 +855,10 @@ class AttachmentTest < Test::Unit::TestCase
assert @attachment.dirty?
end
should "set uploaded_file for access beyond the paperclip lifecycle" do
assert_equal @file, @attachment.uploaded_file
end
context "and saved" do
setup do
@attachment.save
......
require 'rubygems'
require 'tempfile'
require 'pathname'
require 'test/unit'
require 'shoulda'
......
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