Skip to content
This repository has been archived by the owner on Sep 12, 2018. It is now read-only.

Commit

Permalink
Merge branch fix/testSaveInUserTemporaryArea of npcode/yobi
Browse files Browse the repository at this point in the history
from pull request 571
  • Loading branch information
kjkmadness committed Feb 4, 2014
2 parents 7831387 + f5fd54b commit 331ceb2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/Attachment.java
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public boolean store(File file, String name, Resource container) throws IOExcept
new BufferedInputStream(new FileInputStream(file)), meta);
this.mimeType = mediaType.toString();
if (mediaType.getType().toLowerCase().equals("text")) {
this.mimeType += " ;charset=" + FileUtil.detectCharset(new FileInputStream(file));
this.mimeType += "; charset=" + FileUtil.detectCharset(new FileInputStream(file));
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/models/AttachmentTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void testSaveInUserTemporaryArea() throws IOException, NoSuchAlgorithmExc

// Then
assertThat(attach.name).isEqualTo("bar.txt");
assertThat(attach.mimeType).isEqualTo("text/plain");
assertThat(attach.mimeType).isEqualTo("text/plain; charset=UTF-8");
assertThat(new String(b, 0, length)).isEqualTo(new String("Hello"));
}

Expand Down

0 comments on commit 331ceb2

Please sign in to comment.