Refactor: extract test method
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3773 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -61,6 +61,16 @@ class ActiveSupport::TestCase
|
||||
def uploaded_test_file(name, mime)
|
||||
ActionController::TestUploadedFile.new(ActiveSupport::TestCase.fixture_path + "/files/#{name}", mime)
|
||||
end
|
||||
|
||||
# Mock out a file
|
||||
def mock_file
|
||||
file = 'a_file.png'
|
||||
file.stubs(:size).returns(32)
|
||||
file.stubs(:original_filename).returns('a_file.png')
|
||||
file.stubs(:content_type).returns('image/png')
|
||||
file.stubs(:read).returns(false)
|
||||
file
|
||||
end
|
||||
|
||||
# Use a temporary directory for attachment related tests
|
||||
def set_tmp_attachments_directory
|
||||
|
||||
Reference in New Issue
Block a user