aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2017-01-20 14:10:46 +0300
committerGravatar Vitaly Takmazov2017-01-20 14:10:46 +0300
commitfd3b2e951400bf69ca9394d752118b6a3c039516 (patch)
tree912b6473a1b0f8f28f0b58379fe532b3e5c52223 /src/test
parent0736bfd7a02c1c3991be475fae5f70607bf3070f (diff)
juick-server: database tags should not be escaped now
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/com/juick/tests/ApiTests.java6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/test/java/com/juick/tests/ApiTests.java b/src/test/java/com/juick/tests/ApiTests.java
index 0317dbb4..1cd17bd6 100644
--- a/src/test/java/com/juick/tests/ApiTests.java
+++ b/src/test/java/com/juick/tests/ApiTests.java
@@ -17,7 +17,6 @@ import com.juick.service.UserService;
import com.juick.service.search.SearchService;
import com.juick.www.controllers.PageTemplates;
import org.apache.commons.dbcp2.BasicDataSource;
-import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.commons.lang3.StringUtils;
import org.junit.Before;
import org.junit.Test;
@@ -181,9 +180,8 @@ public class ApiTests {
Tag htmlTag = tagService.getTag(htmlTagName, true);
TagStats htmlTagStats = new TagStats();
htmlTagStats.setTag(htmlTag);
- String dbTagName = jdbcTemplate.queryForObject("select name from tags where name=?", String.class, StringEscapeUtils.escapeHtml4(htmlTagName));
- assertNotEquals("db tags should be escaped", dbTagName, htmlTag.getName());
- assertEquals("object tags should unescaped", htmlTag.getName(), StringEscapeUtils.unescapeHtml4(dbTagName));
+ String dbTagName = jdbcTemplate.queryForObject("select name from tags where name=?", String.class, htmlTagName);
+ assertEquals("db tags should not be escaped", dbTagName, htmlTag.getName());
assertEquals("template should encode escaped tag in url and show escaped tag in name",
"<a href=\"/tag/%3E_%3C\" rel=\"nofollow\">&gt;_&lt;</a>", templates.formatTags(Collections.singletonList(htmlTagStats)));
int mid4 = messagesService.createMessage(user_id, "yoyoyo", null, null);