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 RefactorPageResponderTest 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 RefactorPageResponder();
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("Delete Page", content);
38: assertSubString("Rename Page", content);
39: assertSubString("Move Page", content);
40: }
41: }
|