diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-09-30 22:59:23 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-09-30 22:59:23 -0300 |
commit | 628e38d789176bf53822942598547dee21d5ce70 (patch) | |
tree | 7a678bb87a6a0a5b1745d4e42926bfd08b005488 /actionpack/test/controller/test_test.rb | |
parent | 19987b64af0d543a6292c3fd9b0b877f70eab306 (diff) | |
download | rails-628e38d789176bf53822942598547dee21d5ce70.tar.gz rails-628e38d789176bf53822942598547dee21d5ce70.tar.bz2 rails-628e38d789176bf53822942598547dee21d5ce70.zip |
Since File instance doesn't respond to #open use a double to test the
behavior added at c53e5def08f7a289a92a8e5f79dcd7caa5c3a2fb
Diffstat (limited to 'actionpack/test/controller/test_test.rb')
-rw-r--r-- | actionpack/test/controller/test_test.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/actionpack/test/controller/test_test.rb b/actionpack/test/controller/test_test.rb index 677a933ccb..1da5298900 100644 --- a/actionpack/test/controller/test_test.rb +++ b/actionpack/test/controller/test_test.rb @@ -767,9 +767,8 @@ XML end def test_action_dispatch_uploaded_file_upload - filename = 'mona_lisa.jpg' - path = "#{FILES_DIR}/#{filename}" - post :test_file_upload, :file => ActionDispatch::Http::UploadedFile.new(:filename => path, :type => "image/jpg", :tempfile => File.open(path)) + tf = Class.new { def size; 159528 end } + post :test_file_upload, :file => ActionDispatch::Http::UploadedFile.new(:tempfile => tf.new) assert_equal '159528', @response.body end |