BigW Consortium Gitlab

Commit 5eeab9f0 by Sven Strickroth

GoogleCode importer: Do not care about casing of image file extensions

parent d0ef64ac
...@@ -327,7 +327,7 @@ module Gitlab ...@@ -327,7 +327,7 @@ module Gitlab
link = "https://storage.googleapis.com/google-code-attachments/#{@repo.name}/issue-#{issue_id}/comment-#{comment_id}/#{filename}" link = "https://storage.googleapis.com/google-code-attachments/#{@repo.name}/issue-#{issue_id}/comment-#{comment_id}/#{filename}"
text = "[#{filename}](#{link})" text = "[#{filename}](#{link})"
text = "!#{text}" if filename =~ /\.(png|jpg|jpeg|gif|bmp|tiff)\z/ text = "!#{text}" if filename =~ /\.(png|jpg|jpeg|gif|bmp|tiff)\z/i
text text
end.compact end.compact
end end
......
...@@ -382,6 +382,11 @@ ...@@ -382,6 +382,11 @@
"fileName" : "screenshot.png", "fileName" : "screenshot.png",
"fileSize" : 0, "fileSize" : 0,
"mimetype" : "image/png" "mimetype" : "image/png"
}, {
"attachmentId" : "001",
"fileName" : "screenshot1.PNG",
"fileSize" : 0,
"mimetype" : "image/x-png"
} ] } ]
}, { }, {
"id" : 1, "id" : 1,
......
...@@ -65,6 +65,7 @@ describe Gitlab::GoogleCodeImport::Importer do ...@@ -65,6 +65,7 @@ describe Gitlab::GoogleCodeImport::Importer do
expect(issue.description).to include('all the best!') expect(issue.description).to include('all the best!')
expect(issue.description).to include('[tint2_task_scrolling.diff](https://storage.googleapis.com/google-code-attachments/tint2/issue-169/comment-0/tint2_task_scrolling.diff)') expect(issue.description).to include('[tint2_task_scrolling.diff](https://storage.googleapis.com/google-code-attachments/tint2/issue-169/comment-0/tint2_task_scrolling.diff)')
expect(issue.description).to include('![screenshot.png](https://storage.googleapis.com/google-code-attachments/tint2/issue-169/comment-0/screenshot.png)') expect(issue.description).to include('![screenshot.png](https://storage.googleapis.com/google-code-attachments/tint2/issue-169/comment-0/screenshot.png)')
expect(issue.description).to include('![screenshot1.PNG](https://storage.googleapis.com/google-code-attachments/tint2/issue-169/comment-0/screenshot1.PNG)')
end end
it "imports issue comments" do it "imports issue comments" do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment