01: // Copyright (C) 2003,2004,2005 by Object Mentor, Inc. All rights reserved.
02: // Released under the terms of the GNU General Public License version 2 or later.
03: package fitnesse.responders.refactoring;
04:
05: import fitnesse.testutil.AbstractRegex;
06: import fitnesse.wiki.*;
07: import fitnesse.http.*;
08: import fitnesse.*;
09:
10: public class NameStiqPageResponderTest extends AbstractRegex {
11: WikiPage root;
12:
13: private MockRequest request;
14:
15: private Responder responder;
16:
17: private String childPage = "ChildPage";
18:
19: private PageCrawler crawler;
20:
21: public void setUp() throws Exception {
22: root = InMemoryPage.makeRoot("root");
23: crawler = root.getPageCrawler();
24: crawler.addPage(root, PathParser.parse(childPage));
25:
26: request = new MockRequest();
27: request.setResource(childPage);
28: responder = new NewStiqPageResponder();
29: }
30:
31: public void testHtml() throws Exception {
32: SimpleResponse response = (SimpleResponse) responder
33: .makeResponse(new FitNesseContext(root), request);
34: assertEquals(200, response.getStatus());
35:
36: String content = response.getContent();
37: assertSubString("New STIQ Page", content);
38: assertSubString(
39: "<input type=\"radio\" name=\"newStiqPageType\" value=\""
40: + WikiPage.ACTION_TEST
41: + "\" checked=\"checked\"/> "
42: + "<img src=\"/files/images/treeview/test.png\" alt=\""
43: + WikiPage.ACTION_TEST
44: + "\" width=\"22\" height=\"16\"/>"
45: + WikiPage.ACTION_TEST, content);
46: }
47:
48: }
|