summaryrefslogtreecommitdiffstats
path: root/test/test_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_helper.rb')
-rw-r--r--test/test_helper.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/test_helper.rb b/test/test_helper.rb
index dc04fa82d..9a2761021 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -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")