Merged r4010 from trunk.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.0-stable@4022 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Eric Davis 2010-08-22 19:49:08 +00:00
parent b419deb907
commit 7443f2a310
2 changed files with 7 additions and 3 deletions

View File

@ -12,6 +12,6 @@ class Attachment < ActiveRecord::Base
end
def self.generate_file
@file = mock_file
@file = ActiveSupport::TestCase.mock_file
end
end

View File

@ -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")