Commit 7443f2a3 authored by Eric Davis's avatar Eric Davis

Merged r4010 from trunk.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.0-stable@4022 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent b419deb9
......@@ -12,6 +12,6 @@ class Attachment < ActiveRecord::Base
end
def self.generate_file
@file = mock_file
@file = ActiveSupport::TestCase.mock_file
end
end
......@@ -63,7 +63,7 @@ class ActiveSupport::TestCase
end
# Mock out a file
def mock_file
def self.mock_file
file = 'a_file.png'
file.stubs(:size).returns(32)
file.stubs(:original_filename).returns('a_file.png')
......@@ -71,7 +71,11 @@ class ActiveSupport::TestCase
file.stubs(:read).returns(false)
file
end
def mock_file
self.class.mock_file
end
# Use a temporary directory for attachment related tests
def set_tmp_attachments_directory
Dir.mkdir "#{RAILS_ROOT}/tmp/test" unless File.directory?("#{RAILS_ROOT}/tmp/test")
......
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