]> source.dussan.org Git - redmine.git/commitdiff
Fix the mock_file test helper.
authorEric Davis <edavis@littlestreamsoftware.com>
Thu, 19 Aug 2010 22:24:42 +0000 (22:24 +0000)
committerEric Davis <edavis@littlestreamsoftware.com>
Thu, 19 Aug 2010 22:24:42 +0000 (22:24 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4010 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/exemplars/attachment_exemplar.rb
test/test_helper.rb

index 8100fe906ffc434a6352e57f3aa496d6b1a584b3..4baaf530fa8c48291afe655b00592fe48adde238 100644 (file)
@@ -12,6 +12,6 @@ class Attachment < ActiveRecord::Base
   end
 
   def self.generate_file
-    @file = mock_file
+    @file = ActiveSupport::TestCase.mock_file
   end
 end
index dc04fa82d6aaf92249d2971de1e1c13d5123ff98..9a2761021aaa273e4c5cfb33667d3c916b3436e5 100644 (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")