aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/com
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2017-08-18 13:58:34 +0300
committerGravatar Vitaly Takmazov2017-08-18 14:34:21 +0300
commit9c0f37b2fd7535a46c324ff7eb89ed9454aee88f (patch)
treebf663780bbd15deee547c79aa8b42b9735368d67 /src/test/java/com
parentf5a87d2b7072426cfe36527db1270e5f85b73e01 (diff)
www: no more ugnich templates
Diffstat (limited to 'src/test/java/com')
-rw-r--r--src/test/java/com/juick/tests/ApiTests.java13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/test/java/com/juick/tests/ApiTests.java b/src/test/java/com/juick/tests/ApiTests.java
index bd8547a2..03204957 100644
--- a/src/test/java/com/juick/tests/ApiTests.java
+++ b/src/test/java/com/juick/tests/ApiTests.java
@@ -32,7 +32,9 @@ import com.juick.service.TagService;
import com.juick.service.UserService;
import com.juick.service.search.SearchService;
import com.juick.www.WebApp;
-import com.juick.www.controllers.PageTemplates;
+import com.mitchellbosecke.pebble.PebbleEngine;
+import com.mitchellbosecke.pebble.loader.StringLoader;
+import com.mitchellbosecke.pebble.template.PebbleTemplate;
import org.apache.commons.dbcp2.BasicDataSource;
import org.apache.commons.lang3.StringUtils;
import org.junit.Before;
@@ -93,11 +95,6 @@ public class ApiTests {
}
@Bean
- public PageTemplates templates() {
- return new PageTemplates();
- }
-
- @Bean
public PlatformTransactionManager transactionManager() {
return new DataSourceTransactionManager(dataSource());
}
@@ -156,8 +153,6 @@ public class ApiTests {
JdbcTemplate jdbcTemplate;
@Inject
JuickProtocol juickProtocol;
- @Inject
- PageTemplates templates;
@Mock
ProtocolListener listener;
@@ -209,8 +204,6 @@ public class ApiTests {
htmlTagStats.setTag(htmlTag);
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);
Message msg4 = messagesService.getMessage(mid4);
assertEquals("tags string should be empty", StringUtils.EMPTY, msg4.getTagsString());