diff options
author | 黄松 <pinewong@163.com> | 2018-08-25 21:44:11 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-25 21:44:11 +0800 |
commit | f54060916fbb5450cceedaf7187e8e6bed5d44a3 (patch) | |
tree | cb1f4066684d54aed1087f19f12770183915cff2 /actionpack/lib/action_dispatch | |
parent | 519d09cb99813c74d44d8cc7d97684a2fac386b1 (diff) | |
download | rails-f54060916fbb5450cceedaf7187e8e6bed5d44a3.tar.gz rails-f54060916fbb5450cceedaf7187e8e6bed5d44a3.tar.bz2 rails-f54060916fbb5450cceedaf7187e8e6bed5d44a3.zip |
Clarify example of the test [ci skip]
ActionDispatch::TestProcess::FixtureFile
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/testing/test_process.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/testing/test_process.rb b/actionpack/lib/action_dispatch/testing/test_process.rb index 8ac50c730d..0b98f27f11 100644 --- a/actionpack/lib/action_dispatch/testing/test_process.rb +++ b/actionpack/lib/action_dispatch/testing/test_process.rb @@ -8,12 +8,12 @@ module ActionDispatch module FixtureFile # Shortcut for <tt>Rack::Test::UploadedFile.new(File.join(ActionDispatch::IntegrationTest.fixture_path, path), type)</tt>: # - # post :change_avatar, avatar: fixture_file_upload('files/spongebob.png', 'image/png') + # post :change_avatar, params: { avatar: fixture_file_upload('files/spongebob.png', 'image/png') } # # To upload binary files on Windows, pass <tt>:binary</tt> as the last parameter. # This will not affect other platforms: # - # post :change_avatar, avatar: fixture_file_upload('files/spongebob.png', 'image/png', :binary) + # post :change_avatar, params: { avatar: fixture_file_upload('files/spongebob.png', 'image/png', :binary) } def fixture_file_upload(path, mime_type = nil, binary = false) if self.class.respond_to?(:fixture_path) && self.class.fixture_path && !File.exist?(path) |