"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "test/helpers/application_helper_test.rb" between
redmine-4.0.3.tar.gz and redmine-4.0.4.tar.gz

About: Redmine is a flexible project management and bug-tracking web application (using the Ruby on Rails framework). It supports also project wikis and forums, documents management, and multiple version control systems.

application_helper_test.rb  (redmine-4.0.3):application_helper_test.rb  (redmine-4.0.4)
skipping to change at line 157 skipping to change at line 157
'No match: !ogo.gif!' => 'No match: <img src="ogo.gif" alt="" />', 'No match: !ogo.gif!' => 'No match: <img src="ogo.gif" alt="" />',
'No match: !ogo.GIF!' => 'No match: <img src="ogo.GIF" alt="" />', 'No match: !ogo.GIF!' => 'No match: <img src="ogo.GIF" alt="" />',
# link image # link image
'!logo.gif!:http://foo.bar/' => '<a href="http://foo.bar/"><img src="/atta chments/download/3/logo.gif" title="This is a logo" alt="This is a logo" /></a>' , '!logo.gif!:http://foo.bar/' => '<a href="http://foo.bar/"><img src="/atta chments/download/3/logo.gif" title="This is a logo" alt="This is a logo" /></a>' ,
} }
attachments = Attachment.all attachments = Attachment.all
to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable( text, :attachments => attachments) } to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable( text, :attachments => attachments) }
end end
def test_attached_images_with_textile_and_non_ascii_filename def test_attached_images_with_textile_and_non_ascii_filename
attachment = Attachment.generate!(:filename => 'café.jpg') to_test = {
'CAFÉ.JPG' => 'CAF%C3%89.JPG',
'crème.jpg' => 'cr%C3%A8me.jpg',
}
with_settings :text_formatting => 'textile' do with_settings :text_formatting => 'textile' do
assert_include %(<img src="/attachments/download/#{attachment.id}/caf%C3%A to_test.each do |filename, result|
9.jpg" alt="" />), attachment = Attachment.generate!(:filename => filename)
textilizable("!café.jpg!)", :attachments => [attachment]) assert_include %(<img src="/attachments/download/#{attachment.id}/#{resu
lt}" alt="" />), textilizable("!#{filename}!", :attachments => [attachment])
end
end end
end end
def test_attached_images_with_markdown_and_non_ascii_filename def test_attached_images_with_markdown_and_non_ascii_filename
skip unless Object.const_defined?(:Redcarpet) skip unless Object.const_defined?(:Redcarpet)
attachment = Attachment.generate!(:filename => 'café.jpg') to_test = {
'CAFÉ.JPG' => 'CAF%C3%89.JPG',
'crème.jpg' => 'cr%C3%A8me.jpg',
}
with_settings :text_formatting => 'markdown' do with_settings :text_formatting => 'markdown' do
assert_include %(<img src="/attachments/download/#{attachment.id}/caf%C3%A to_test.each do |filename, result|
9.jpg" alt="" />), attachment = Attachment.generate!(:filename => filename)
textilizable("![](café.jpg)", :attachments => [attachment]) assert_include %(<img src="/attachments/download/#{attachment.id}/#{resu
lt}" alt="" />), textilizable("![](#{filename})", :attachments => [attachment])
end
end end
end end
def test_attached_images_with_hires_naming def test_attached_images_with_hires_naming
attachment = Attachment.generate!(:filename => 'image@2x.png') attachment = Attachment.generate!(:filename => 'image@2x.png')
assert_equal %(<p><img src="/attachments/download/#{attachment.id}/image@2 x.png" srcset="/attachments/download/#{attachment.id}/image@2x.png 2x" alt="" /> </p>), assert_equal %(<p><img src="/attachments/download/#{attachment.id}/image@2 x.png" srcset="/attachments/download/#{attachment.id}/image@2x.png 2x" alt="" /> </p>),
textilizable("!image@2x.png!", :attachments => [attachment]) textilizable("!image@2x.png!", :attachments => [attachment])
end end
def test_attached_images_filename_extension def test_attached_images_filename_extension
 End of changes. 4 change blocks. 
8 lines changed or deleted 18 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)