diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-11-23 05:30:53 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-11-23 05:30:53 +0000 |
commit | 9be9c5f5658489325b0bd1068683d86d3a4d20b7 (patch) | |
tree | ecdf09defc4ff8768d36ccdeb761ed9649b7b576 /test/test_helper.rb | |
parent | 68f3e91bd7030c7ac0a33bb0bfa36b30a3645d32 (diff) | |
download | redmine-9be9c5f5658489325b0bd1068683d86d3a4d20b7.tar.gz redmine-9be9c5f5658489325b0bd1068683d86d3a4d20b7.zip |
fix inconsistent image filename extensions (#9638)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7891 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/test_helper.rb')
-rw-r--r-- | test/test_helper.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test_helper.rb b/test/test_helper.rb index cf79cf209..78b83c06d 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -77,6 +77,17 @@ class ActiveSupport::TestCase self.class.mock_file end + def mock_file_with_options(options={}) + file = '' + file.stubs(:size).returns(32) + original_filename = options[:original_filename] || nil + file.stubs(:original_filename).returns(original_filename) + content_type = options[:content_type] || nil + file.stubs(:content_type).returns(content_type) + file.stubs(:read).returns(false) + 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") |