Add auto-configuration for Thymeleaf data dialect

Closes #1120
This commit is contained in:
Max Bruchmann
2014-06-18 01:39:29 +02:00
committed by Andy Wilkinson
parent 53d24301d1
commit ee40fb8cf1
5 changed files with 59 additions and 24 deletions

View File

@@ -137,4 +137,15 @@ public class ThymeleafAutoConfigurationTests {
context.close();
}
@Test
public void useDataDialect() throws Exception {
this.context.register(ThymeleafAutoConfiguration.class,
PropertyPlaceholderAutoConfiguration.class);
this.context.refresh();
TemplateEngine engine = this.context.getBean(TemplateEngine.class);
Context attrs = new Context(Locale.UK, Collections.singletonMap("foo", "bar"));
String result = engine.process("data-dialect", attrs);
assertEquals("<html><body data-foo=\"bar\"></body></html>", result);
}
}

View File

@@ -0,0 +1 @@
<html><body data:foo="${foo}"></body></html>