diff options
author | Eric Davis <edavis@littlestreamsoftware.com> | 2010-06-19 03:54:23 +0000 |
---|---|---|
committer | Eric Davis <edavis@littlestreamsoftware.com> | 2010-06-19 03:54:23 +0000 |
commit | cf334cee3189a84ca6fb0554e16ebcd740409a11 (patch) | |
tree | b252826ffaa73337dd628f2290f6d09bd950cbb9 /test/test_helper.rb | |
parent | c56c0f411c577fe17b64fe33875cad5d75e34284 (diff) | |
download | redmine-cf334cee3189a84ca6fb0554e16ebcd740409a11.tar.gz redmine-cf334cee3189a84ca6fb0554e16ebcd740409a11.zip |
Refactor: extract test method
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3773 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/test_helper.rb')
-rw-r--r-- | test/test_helper.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/test_helper.rb b/test/test_helper.rb index cb043fa89..1f735f5f6 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -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 |