Project

General

Profile

Patch #44330 » 0001-Convert-CRLF-line-endings-to-LF-in-three-test-fixtur.patch

Go MAEDA, 2026-08-13 09:45

View differences:

test/fixtures/attachments.yml
downloads: 0
disk_filename: 060719210727_changeset_utf8.diff
disk_directory: "2006/07"
digest: b91e08d0cf966d5c6ff411bd8c4cc3a2
digest: 2d3ac709c87ac66767eebbcf35adbdbd
id: 14
filesize: 687
filesize: 691
filename: changeset_utf8.diff
author_id: 2
content_type: text/x-diff
......
downloads: 0
disk_filename: 060719210727_changeset_utf8.diff
disk_directory: "2006/07"
digest: b91e08d0cf966d5c6ff411bd8c4cc3a2
filesize: 687
digest: 2d3ac709c87ac66767eebbcf35adbdbd
filesize: 691
filename: private.diff
author_id: 2
content_type: text/x-diff
......
downloads: 0
disk_filename: 190430092344_redmine_logo.ai.unknown
disk_directory: "2019/04"
digest: 68d90c016f0806d88234a6f16530fdf0b7f1d2481354798f1a5fd165dca6b04f
digest: c8122679a497a2089d5fc3ac151475183867a090afa0862dbfd9286c4a0e9576
id: 22
filesize: 4994
filesize: 4762
filename: redmine_logo.ai.unknown
author_id: 1
description: unknown type
test/fixtures/files/2006/07/060719210727_changeset_utf8.diff
Index: trunk/app/controllers/issues_controller.rb
===================================================================
--- trunk/app/controllers/issues_controller.rb (révision 1483)
+++ trunk/app/controllers/issues_controller.rb (révision 1484)
@@ -149,7 +149,7 @@
attach_files(@issue, params[:attachments])
flash[:notice] = 'Demande créée avec succès'
Mailer.deliver_issue_add(@issue) if Setting.notified_events.include?('issue_added')
- redirect_to :controller => 'issues', :action => 'show', :id => @issue, :project_id => @project
+ redirect_to :controller => 'issues', :action => 'show', :id => @issue
return
end
end
Index: trunk/app/controllers/issues_controller.rb
===================================================================
--- trunk/app/controllers/issues_controller.rb (révision 1483)
+++ trunk/app/controllers/issues_controller.rb (révision 1484)
@@ -149,7 +149,7 @@
attach_files(@issue, params[:attachments])
flash[:notice] = 'Demande créée avec succès'
Mailer.deliver_issue_add(@issue) if Setting.notified_events.include?('issue_added')
- redirect_to :controller => 'issues', :action => 'show', :id => @issue, :project_id => @project
+ redirect_to :controller => 'issues', :action => 'show', :id => @issue
return
end
end
test/fixtures/files/2019/04/190430092344_redmine_logo.ai.unknown
%!PS-Adobe-3.0
%%Creator: Adobe Fireworks
%%DocumentNeededResources: procset Adobe_level2_AI5 1.0 0
%%+ procset Adobe_packedarray 2.0 0
%%+ procset Adobe_cmykcolor 1.1 0
%%+ procset Adobe_cshow 1.1 0
%%+ procset Adobe_customcolor 1.0 0
%%+ procset Adobe_typography_AI5 1.0 0
%%+ procset Adobe_Illustrator_AI5 1.0 0
%%BoundingBox:0 0 183 94
%AI3_TemplateBox: 0 0 183 94
%%PageOrigin:0 0
%AI5_FileFormat 3
%AI3_ColorUsage: Color
%%DocumentProcessColors: Cyan Magenta Yellow Black
%%EndComments
%%BeginProlog
%%EndProlog
%%BeginSetup
Adobe_packedarray /initialize get exec
Adobe_cmykcolor /initialize get exec
Adobe_cshow /initialize get exec
Adobe_customcolor /initialize get exec
Adobe_typography_AI5 /initialize get exec
Adobe_Illustrator_AI5 /initialize get exec
[
39/quotesingle 96/grave 130/quotesinglbase 131/florin 132/quotedblbase
133/ellipsis 134/dagger 135/daggerdbl 136/circumflex 137/perthousand
139/guilsinglleft 140/OE 145/quoteleft 146/quoteright 147/quotedblleft
148/quotedblright 149/bullet 150/endash 151/emdash 152/tilde
155/guilsinglright 156/oe 157/dotlessi 159/Ydieresis 164/currency
166/brokenbar 168/dieresis 169/copyright 170/ordfeminine 172/logicalnot
174/registered 175/macron 176/ring 177/plusminus 178/twosuperior
179/threesuperior 180/acute 181/mu 183/periodcentered 184/cedilla
185/onesuperior 186/ordmasculine 188/onequarter 189/onehalf
190/threequarters 192/Agrave 193/Aacute 194/Acircumflex 195/Atilde
196/Adieresis 197/Aring 198/AE 199/Ccedilla 200/Egrave 201/Eacute
202/Ecircumflex 203/Edieresis 204/Igrave 205/Iacute 206/Icircumflex
207/Idieresis 208/Eth 209/Ntilde 210/Ograve 211/Oacute 212/Ocircumflex
213/Otilde 214/Odieresis 215/multiply 216/Oslash 217/Ugrave 218/Uacute
219/Ucircumflex 220/Udieresis 221/Yacute 222/Thorn 223/germandbls
224/agrave 225/aacute 226/acircumflex 227/atilde 228/adieresis
229/aring 230/ae 231/ccedilla 232/egrave 233/eacute 234/ecircumflex
235/edieresis 236/igrave 237/iacute 238/icircumflex 239/idieresis
240/eth 241/ntilde 242/ograve 243/oacute 244/ocircumflex 245/otilde
246/odieresis 247/divide 248/oslash 249/ugrave 250/uacute 251/ucircumflex
252/udieresis 253/yacute 254/thorn 255/ydieresis
TE
%AI3_BeginEncoding: _Delicious-Bold-Bold Delicious-Bold-Bold
[/_Delicious-Bold-Bold/Delicious-Bold-Bold 0 0 0 TZ
%AI3_EndEncoding TrueType
%%EndSetup
1 1 1 1 0 0 0 79 128 255 Lb
(Ebene 1) Ln
0.000 0.000 0.000 Xa
1 XR
44.00 44.80 m
49.60 44.80 l
50.00 49.60 l
44.80 50.80 l
44.00 44.80 l
f
0.000 0.000 0.000 Xa
1 XR
45.00 51.60 m
50.00 50.40 l
51.20 54.60 l
47.00 56.80 l
45.00 51.60 l
f
0.000 0.000 0.000 Xa
1 XR
47.40 57.60 m
51.40 55.40 l
54.60 57.60 l
51.60 61.00 l
47.40 57.60 l
f
0.000 0.000 0.000 Xa
1 XR
69.80 44.80 m
64.20 44.80 l
63.80 49.60 l
69.00 50.80 l
69.80 44.80 l
f
0.000 0.000 0.000 Xa
1 XR
68.80 51.60 m
63.80 50.40 l
62.60 54.60 l
66.80 56.80 l
68.80 51.60 l
f
0.000 0.000 0.000 Xa
1 XR
66.40 57.60 m
62.40 55.40 l
59.20 57.60 l
62.20 61.00 l
66.40 57.60 l
f
0.000 0.000 0.000 Xa
1 XR
52.60 61.60 m
55.60 58.00 l
58.40 58.00 l
61.00 61.60 l
58.40 62.40 l
55.53 62.40 l
52.60 61.60 l
f
1 To
1 0 0 1 74 43 0.000000 Tp
74.80 43.20 m
141.58 43.20 l
141.58 34.56 l
74.80 34.56 l
74.80 43.20 l
n
TP
0 -14.00 Td
0.200 0.200 0.200 Xa
/_Delicious-Bold-Bold 14.00 Tf
0.000000 Ts
100.000000 100.0 Tz
1 0 Tk
0.000000 Tt
0 Ta
0.200 0.200 0.200 Xa
0 Tr
(Flexible Project Management) Tj
TO
1 To
1 0 0 1 74 60 0.000000 Tp
74.00 60.00 m
139.29 60.00 l
139.29 36.48 l
74.00 36.48 l
74.00 60.00 l
n
TP
0 -45.00 Td
0.604 0.027 0.000 Xa
/_Delicious-Bold-Bold 45.00 Tf
0.000000 Ts
100.000000 100.0 Tz
1 0 Tk
0.000000 Tt
0 Ta
0.604 0.027 0.000 Xa
0 Tr
(RED) Tj
/_Delicious-Bold-Bold 45.00 Tf
0.000000 Ts
100.000000 100.0 Tz
1 0 Tk
0.000000 Tt
0 Ta
0.753 0.106 0.102 Xa
0 Tr
(MINE) Tj
TO
0.604 0.027 0.000 Xa
1 XR
44.00 44.80 m
49.60 44.80 l
50.00 49.60 l
44.80 50.80 l
44.00 44.80 l
f
0.706 0.055 0.059 Xa
1 XR
45.00 51.60 m
50.00 50.40 l
51.20 54.60 l
47.00 56.80 l
45.00 51.60 l
f
0.753 0.106 0.102 Xa
1 XR
47.40 57.60 m
51.40 55.40 l
54.60 57.60 l
51.60 61.00 l
47.40 57.60 l
f
0.604 0.027 0.000 Xa
1 XR
69.80 44.80 m
64.20 44.80 l
63.80 49.60 l
69.00 50.80 l
69.80 44.80 l
f
0.706 0.055 0.059 Xa
1 XR
68.80 51.60 m
63.80 50.40 l
62.60 54.60 l
66.80 56.80 l
68.80 51.60 l
f
0.753 0.106 0.102 Xa
1 XR
66.40 57.60 m
62.40 55.40 l
59.20 57.60 l
62.20 61.00 l
66.40 57.60 l
f
0.753 0.106 0.102 Xa
1 XR
52.60 61.60 m
55.60 58.00 l
58.40 58.00 l
61.00 61.60 l
58.40 62.40 l
55.53 62.40 l
52.60 61.60 l
f
LB
%%PageTrailer
gsave annotatepage grestore showpage
%%Trailer
Adobe_Illustrator_AI5 /terminate get exec
Adobe_typography_AI5 /terminate get exec
Adobe_customcolor /terminate get exec
Adobe_cshow /terminate get exec
Adobe_cmykcolor /terminate get exec
Adobe_packedarray /terminate get exec
%%EOF
%!PS-Adobe-3.0
%%Creator: Adobe Fireworks
%%DocumentNeededResources: procset Adobe_level2_AI5 1.0 0
%%+ procset Adobe_packedarray 2.0 0
%%+ procset Adobe_cmykcolor 1.1 0
%%+ procset Adobe_cshow 1.1 0
%%+ procset Adobe_customcolor 1.0 0
%%+ procset Adobe_typography_AI5 1.0 0
%%+ procset Adobe_Illustrator_AI5 1.0 0
%%BoundingBox:0 0 183 94
%AI3_TemplateBox: 0 0 183 94
%%PageOrigin:0 0
%AI5_FileFormat 3
%AI3_ColorUsage: Color
%%DocumentProcessColors: Cyan Magenta Yellow Black
%%EndComments
%%BeginProlog
%%EndProlog
%%BeginSetup
Adobe_packedarray /initialize get exec
Adobe_cmykcolor /initialize get exec
Adobe_cshow /initialize get exec
Adobe_customcolor /initialize get exec
Adobe_typography_AI5 /initialize get exec
Adobe_Illustrator_AI5 /initialize get exec
[
39/quotesingle 96/grave 130/quotesinglbase 131/florin 132/quotedblbase
133/ellipsis 134/dagger 135/daggerdbl 136/circumflex 137/perthousand
139/guilsinglleft 140/OE 145/quoteleft 146/quoteright 147/quotedblleft
148/quotedblright 149/bullet 150/endash 151/emdash 152/tilde
155/guilsinglright 156/oe 157/dotlessi 159/Ydieresis 164/currency
166/brokenbar 168/dieresis 169/copyright 170/ordfeminine 172/logicalnot
174/registered 175/macron 176/ring 177/plusminus 178/twosuperior
179/threesuperior 180/acute 181/mu 183/periodcentered 184/cedilla
185/onesuperior 186/ordmasculine 188/onequarter 189/onehalf
190/threequarters 192/Agrave 193/Aacute 194/Acircumflex 195/Atilde
196/Adieresis 197/Aring 198/AE 199/Ccedilla 200/Egrave 201/Eacute
202/Ecircumflex 203/Edieresis 204/Igrave 205/Iacute 206/Icircumflex
207/Idieresis 208/Eth 209/Ntilde 210/Ograve 211/Oacute 212/Ocircumflex
213/Otilde 214/Odieresis 215/multiply 216/Oslash 217/Ugrave 218/Uacute
219/Ucircumflex 220/Udieresis 221/Yacute 222/Thorn 223/germandbls
224/agrave 225/aacute 226/acircumflex 227/atilde 228/adieresis
229/aring 230/ae 231/ccedilla 232/egrave 233/eacute 234/ecircumflex
235/edieresis 236/igrave 237/iacute 238/icircumflex 239/idieresis
240/eth 241/ntilde 242/ograve 243/oacute 244/ocircumflex 245/otilde
246/odieresis 247/divide 248/oslash 249/ugrave 250/uacute 251/ucircumflex
252/udieresis 253/yacute 254/thorn 255/ydieresis
TE
%AI3_BeginEncoding: _Delicious-Bold-Bold Delicious-Bold-Bold
[/_Delicious-Bold-Bold/Delicious-Bold-Bold 0 0 0 TZ
%AI3_EndEncoding TrueType
%%EndSetup
1 1 1 1 0 0 0 79 128 255 Lb
(Ebene 1) Ln
0.000 0.000 0.000 Xa
1 XR
44.00 44.80 m
49.60 44.80 l
50.00 49.60 l
44.80 50.80 l
44.00 44.80 l
f
0.000 0.000 0.000 Xa
1 XR
45.00 51.60 m
50.00 50.40 l
51.20 54.60 l
47.00 56.80 l
45.00 51.60 l
f
0.000 0.000 0.000 Xa
1 XR
47.40 57.60 m
51.40 55.40 l
54.60 57.60 l
51.60 61.00 l
47.40 57.60 l
f
0.000 0.000 0.000 Xa
1 XR
69.80 44.80 m
64.20 44.80 l
63.80 49.60 l
69.00 50.80 l
69.80 44.80 l
f
0.000 0.000 0.000 Xa
1 XR
68.80 51.60 m
63.80 50.40 l
62.60 54.60 l
66.80 56.80 l
68.80 51.60 l
f
0.000 0.000 0.000 Xa
1 XR
66.40 57.60 m
62.40 55.40 l
59.20 57.60 l
62.20 61.00 l
66.40 57.60 l
f
0.000 0.000 0.000 Xa
1 XR
52.60 61.60 m
55.60 58.00 l
58.40 58.00 l
61.00 61.60 l
58.40 62.40 l
55.53 62.40 l
52.60 61.60 l
f
1 To
1 0 0 1 74 43 0.000000 Tp
74.80 43.20 m
141.58 43.20 l
141.58 34.56 l
74.80 34.56 l
74.80 43.20 l
n
TP
0 -14.00 Td
0.200 0.200 0.200 Xa
/_Delicious-Bold-Bold 14.00 Tf
0.000000 Ts
100.000000 100.0 Tz
1 0 Tk
0.000000 Tt
0 Ta
0.200 0.200 0.200 Xa
0 Tr
(Flexible Project Management) Tj
TO
1 To
1 0 0 1 74 60 0.000000 Tp
74.00 60.00 m
139.29 60.00 l
139.29 36.48 l
74.00 36.48 l
74.00 60.00 l
n
TP
0 -45.00 Td
0.604 0.027 0.000 Xa
/_Delicious-Bold-Bold 45.00 Tf
0.000000 Ts
100.000000 100.0 Tz
1 0 Tk
0.000000 Tt
0 Ta
0.604 0.027 0.000 Xa
0 Tr
(RED) Tj
/_Delicious-Bold-Bold 45.00 Tf
0.000000 Ts
100.000000 100.0 Tz
1 0 Tk
0.000000 Tt
0 Ta
0.753 0.106 0.102 Xa
0 Tr
(MINE) Tj
TO
0.604 0.027 0.000 Xa
1 XR
44.00 44.80 m
49.60 44.80 l
50.00 49.60 l
44.80 50.80 l
44.00 44.80 l
f
0.706 0.055 0.059 Xa
1 XR
45.00 51.60 m
50.00 50.40 l
51.20 54.60 l
47.00 56.80 l
45.00 51.60 l
f
0.753 0.106 0.102 Xa
1 XR
47.40 57.60 m
51.40 55.40 l
54.60 57.60 l
51.60 61.00 l
47.40 57.60 l
f
0.604 0.027 0.000 Xa
1 XR
69.80 44.80 m
64.20 44.80 l
63.80 49.60 l
69.00 50.80 l
69.80 44.80 l
f
0.706 0.055 0.059 Xa
1 XR
68.80 51.60 m
63.80 50.40 l
62.60 54.60 l
66.80 56.80 l
68.80 51.60 l
f
0.753 0.106 0.102 Xa
1 XR
66.40 57.60 m
62.40 55.40 l
59.20 57.60 l
62.20 61.00 l
66.40 57.60 l
f
0.753 0.106 0.102 Xa
1 XR
52.60 61.60 m
55.60 58.00 l
58.40 58.00 l
61.00 61.60 l
58.40 62.40 l
55.53 62.40 l
52.60 61.60 l
f
LB
%%PageTrailer
gsave annotatepage grestore showpage
%%Trailer
Adobe_Illustrator_AI5 /terminate get exec
Adobe_typography_AI5 /terminate get exec
Adobe_customcolor /terminate get exec
Adobe_cshow /terminate get exec
Adobe_cmykcolor /terminate get exec
Adobe_packedarray /terminate get exec
%%EOF
test/fixtures/files/testfile.txt
this is a text file for upload tests
with multiple lines
this is a text file for upload tests
with multiple lines
test/functional/issues_controller_test.rb
assert_equal 'testfile.txt', attachment.filename
assert_equal 'text/plain', attachment.content_type
assert_equal 'test file', attachment.description
assert_equal 59, attachment.filesize
assert_equal 57, attachment.filesize
assert File.exist?(attachment.diskfile)
assert_equal 59, File.size(attachment.diskfile)
assert_equal 57, File.size(attachment.diskfile)
end
def test_post_create_with_attachment_should_notify_with_attachments
......
assert_equal 'testfile.txt', attachment.filename
assert_equal 'text/plain', attachment.content_type
assert_equal 'test file', attachment.description
assert_equal 59, attachment.filesize
assert_equal 57, attachment.filesize
assert File.exist?(attachment.diskfile)
assert_equal 59, File.size(attachment.diskfile)
assert_equal 57, File.size(attachment.diskfile)
mail = ActionMailer::Base.deliveries.last
assert_mail_body_match 'testfile.txt', mail
test/integration/issues_test.rb
assert_equal 'testfile.txt', attachment.filename
assert_equal 'This is an attachment', attachment.description
# verify the size of the attachment stored in db
assert_equal 59, attachment.filesize
assert_equal 57, attachment.filesize
# verify that the attachment was written to disk
assert File.exist?(attachment.diskfile)
# remove the attachments
test/unit/attachment_test.rb
:author => User.find(1))
assert a.save
assert_equal 'testfile.txt', a.filename
assert_equal 59, a.filesize
assert_equal 57, a.filesize
assert_equal 'text/plain', a.content_type
assert_equal 0, a.downloads
assert_equal '6bc2eb7e87cfbf9145065689aaa8b5f513089ca0af68e2dc41f9cc025473d106', a.digest
assert_equal 'a34a5bf3644efc1b29f2f30a5b338a11da9b42c84a65a0b32501e75c08620111', a.digest
assert a.disk_directory
assert_match %r{\A\d{4}/\d{2}\z}, a.disk_directory
assert File.exist?(a.diskfile)
assert_equal 59, File.size(a.diskfile)
assert_equal 57, File.size(a.diskfile)
end
def test_create_should_clear_content_type_if_too_long
......
:author => User.find(1))
assert a.save
assert_equal 'testfile.txt', a.filename
assert_equal 59, a.filesize
assert_equal 57, a.filesize
assert_equal 'text/plain', a.content_type
assert_equal 0, a.downloads
assert_equal '6bc2eb7e87cfbf9145065689aaa8b5f513089ca0af68e2dc41f9cc025473d106', a.digest
assert_equal 'a34a5bf3644efc1b29f2f30a5b338a11da9b42c84a65a0b32501e75c08620111', a.digest
diskfile = a.diskfile
assert File.exist?(diskfile)
assert_equal 59, File.size(a.diskfile)
assert_equal 57, File.size(a.diskfile)
assert a.destroy
assert !File.exist?(diskfile)
end
......
attachment = Attachment.order(id: :desc).first
assert_equal issue, attachment.container
assert_equal 'testfile.txt', attachment.filename
assert_equal 59, attachment.filesize
assert_equal 57, attachment.filesize
assert_equal 'test', attachment.description
assert_equal 'text/plain', attachment.content_type
assert File.exist?(attachment.diskfile)
assert_equal 59, File.size(attachment.diskfile)
assert_equal 57, File.size(attachment.diskfile)
end
test "Attachmnet.attach_files should add unsaved files to the object as unsaved attachments" do
(2-2/3)