Permalink
Browse files

Adding tests for incorrect function used in form.ctp.

Fixing mistyped function name. Fixes #364
  • Loading branch information...
1 parent 3ad0595 commit 39078932632f1b3627164d742263d49bf48736ad @markstory markstory committed Nov 26, 2009
@@ -24,7 +24,7 @@
<?php
echo "\t<?php\n";
foreach ($fields as $field) {
- if (substr($action, 'add') !== false && $field == $primaryKey) {
+ if (strpos($action, 'add') !== false && $field == $primaryKey) {
continue;
} elseif (!in_array($field, array('created', 'modified', 'updated'))) {
echo "\t\techo \$this->Form->input('{$field}');\n";
@@ -336,6 +336,11 @@ function testGetContentWithAdminAction() {
$this->assertPattern('/testViewModel\[\'TestViewModel\'\]\[\'name\'\]/', $result);
$this->assertPattern('/testViewModel\[\'TestViewModel\'\]\[\'body\'\]/', $result);
+ $result = $this->Task->getContent('admin_add', $vars);
+ $this->assertPattern("/input\('name'\)/", $result);
+ $this->assertPattern("/input\('body'\)/", $result);
+ $this->assertPattern('/List .+Test View Models/', $result);
+
Configure::write('Routing', $_back);
}

0 comments on commit 3907893

Please sign in to comment.