Skip to content

Commit

Permalink
[playframework#862] fixed layout-rendering in FasTags._render
Browse files Browse the repository at this point in the history
  • Loading branch information
mbknor committed May 25, 2011
1 parent 6773edf commit 36f4fb6
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 1 deletion.
3 changes: 2 additions & 1 deletion framework/src/play/templates/FastTags.java
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,8 @@ public static void _render(Map<?, ?> args, Closure body, PrintWriter out, Execut
Map<String, Object> newArgs = new HashMap<String, Object>();
newArgs.putAll((Map<? extends String, ? extends Object>) args);
newArgs.put("_isInclude", true);
out.println(t.internalRender(newArgs));
newArgs.put("out", out);
t.internalRender(newArgs);
} catch (TemplateNotFoundException e) {
throw new TemplateNotFoundException(e.getPath(), template.template, fromLine);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,4 +271,8 @@ public static void selectTag(){
}
render(users);
}

public static void fastTag_render_test() {
render();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#{extends 'Application/fastTag_render_test_layout.html' /}Inner#{render 'Application/fastTag_render_test_renderPart.html' /}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Outer#{doLayout /}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
RenderPart
6 changes: 6 additions & 0 deletions samples-and-tests/just-test-cases/test/ApplicationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ public void testSimpleStatusCode() {
public void testGettingUTF8FromConfig() {
assertEquals("欢迎", Play.configuration.getProperty("utf8value"));
}

@Test
public void testFastTag_render() {
Response response = GET("/application/fastTag_render_test");
assertContentEquals("OuterInnerRenderPart", response);
}

}

0 comments on commit 36f4fb6

Please sign in to comment.