Browse Source

Merged r4010 from trunk.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.0-stable@4022 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/1.0.1
Eric Davis 14 years ago
parent
commit
7443f2a310
2 changed files with 7 additions and 3 deletions
  1. 1
    1
      test/exemplars/attachment_exemplar.rb
  2. 6
    2
      test/test_helper.rb

+ 1
- 1
test/exemplars/attachment_exemplar.rb 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

+ 6
- 2
test/test_helper.rb 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")

Loading…
Cancel
Save