1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Remove mona lisa image from the tests

This image has copyright that we are not giving so it is better to use
one image that we own the copyright.
This commit is contained in:
Rafael Mendonça França 2016-10-25 12:31:35 -02:00
parent 8b3ed2b68a
commit d1700d33a0
No known key found for this signature in database
GPG key ID: FC23B6D0F1EEE948
5 changed files with 19 additions and 19 deletions

View file

@ -1070,8 +1070,8 @@ class IntegrationFileUploadTest < ActionDispatch::IntegrationTest
def test_fixture_file_upload
post "/test_file_upload",
params: {
file: fixture_file_upload("/mona_lisa.jpg", "image/jpg")
file: fixture_file_upload("/ruby_on_rails.jpg", "image/jpg")
}
assert_equal "159528", @response.body
assert_equal "45142", @response.body
end
end

View file

@ -781,7 +781,7 @@ XML
READ_PLAIN = "r:binary"
def test_test_uploaded_file
filename = "mona_lisa.jpg"
filename = "ruby_on_rails.jpg"
path = "#{FILES_DIR}/#{filename}"
content_type = "image/png"
expected = File.read(path)
@ -801,13 +801,13 @@ XML
def test_fixture_path_is_accessed_from_self_instead_of_active_support_test_case
TestCaseTest.stub :fixture_path, FILES_DIR do
uploaded_file = fixture_file_upload("/mona_lisa.jpg", "image/png")
assert_equal File.open("#{FILES_DIR}/mona_lisa.jpg", READ_PLAIN).read, uploaded_file.read
uploaded_file = fixture_file_upload("/ruby_on_rails.jpg", "image/png")
assert_equal File.open("#{FILES_DIR}/ruby_on_rails.jpg", READ_PLAIN).read, uploaded_file.read
end
end
def test_test_uploaded_file_with_binary
filename = "mona_lisa.jpg"
filename = "ruby_on_rails.jpg"
path = "#{FILES_DIR}/#{filename}"
content_type = "image/png"
@ -819,7 +819,7 @@ XML
end
def test_fixture_file_upload_with_binary
filename = "mona_lisa.jpg"
filename = "ruby_on_rails.jpg"
path = "#{FILES_DIR}/#{filename}"
content_type = "image/jpg"
@ -831,44 +831,44 @@ XML
end
def test_fixture_file_upload_should_be_able_access_to_tempfile
file = fixture_file_upload(FILES_DIR + "/mona_lisa.jpg", "image/jpg")
file = fixture_file_upload(FILES_DIR + "/ruby_on_rails.jpg", "image/jpg")
assert file.respond_to?(:tempfile), "expected tempfile should respond on fixture file object, got nothing"
end
def test_fixture_file_upload
post :test_file_upload,
params: {
file: fixture_file_upload(FILES_DIR + "/mona_lisa.jpg", "image/jpg")
file: fixture_file_upload(FILES_DIR + "/ruby_on_rails.jpg", "image/jpg")
}
assert_equal "159528", @response.body
assert_equal "45142", @response.body
end
def test_fixture_file_upload_relative_to_fixture_path
TestCaseTest.stub :fixture_path, FILES_DIR do
uploaded_file = fixture_file_upload("mona_lisa.jpg", "image/jpg")
assert_equal File.open("#{FILES_DIR}/mona_lisa.jpg", READ_PLAIN).read, uploaded_file.read
uploaded_file = fixture_file_upload("ruby_on_rails.jpg", "image/jpg")
assert_equal File.open("#{FILES_DIR}/ruby_on_rails.jpg", READ_PLAIN).read, uploaded_file.read
end
end
def test_fixture_file_upload_ignores_fixture_path_given_full_path
TestCaseTest.stub :fixture_path, File.dirname(__FILE__) do
uploaded_file = fixture_file_upload("#{FILES_DIR}/mona_lisa.jpg", "image/jpg")
assert_equal File.open("#{FILES_DIR}/mona_lisa.jpg", READ_PLAIN).read, uploaded_file.read
uploaded_file = fixture_file_upload("#{FILES_DIR}/ruby_on_rails.jpg", "image/jpg")
assert_equal File.open("#{FILES_DIR}/ruby_on_rails.jpg", READ_PLAIN).read, uploaded_file.read
end
end
def test_fixture_file_upload_ignores_nil_fixture_path
uploaded_file = fixture_file_upload("#{FILES_DIR}/mona_lisa.jpg", "image/jpg")
assert_equal File.open("#{FILES_DIR}/mona_lisa.jpg", READ_PLAIN).read, uploaded_file.read
uploaded_file = fixture_file_upload("#{FILES_DIR}/ruby_on_rails.jpg", "image/jpg")
assert_equal File.open("#{FILES_DIR}/ruby_on_rails.jpg", READ_PLAIN).read, uploaded_file.read
end
def test_action_dispatch_uploaded_file_upload
filename = "mona_lisa.jpg"
filename = "ruby_on_rails.jpg"
path = "#{FILES_DIR}/#{filename}"
post :test_file_upload, params: {
file: Rack::Test::UploadedFile.new(path, "image/jpg", true)
}
assert_equal "159528", @response.body
assert_equal "45142", @response.body
end
def test_test_uploaded_file_exception_when_file_doesnt_exist

View file

@ -142,7 +142,7 @@ class MultipartParamsParsingTest < ActionDispatch::IntegrationTest
test "uploads and reads binary file" do
with_test_routing do
fixture = FIXTURE_PATH + "/mona_lisa.jpg"
fixture = FIXTURE_PATH + "/ruby_on_rails.jpg"
params = { uploaded_data: fixture_file_upload(fixture, "image/jpg") }
post "/read", params: params
end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB