Index: modules/contact/contact.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/contact/contact.test,v
retrieving revision 1.7
diff -u -r1.7 contact.test
--- modules/contact/contact.test	22 Jul 2008 20:08:44 -0000	1.7
+++ modules/contact/contact.test	27 Jul 2008 01:29:32 -0000
@@ -60,7 +60,12 @@
     $recipients = array('simpletest@example.com', 'simpletest2@example.com', 'simpletest3@example.com');
     $this->addCategory($category = $this->randomName(16), implode(',', array($recipients[0])), '', TRUE);
     $this->assertRaw(t('Category %category has been added.', array('%category' => $category)), t('Category successfully added.'));
-
+		
+		// Test update contact form category
+		$categories = $this->getCategories();
+		$this->updateCategory($categories, $category = $this->randomName(16), implode(',', array($recipients[0], $recipients[1])), '', FALSE);
+    $this->assertRaw(t('Category %category has been updated.', array('%category' => $category)), t('Category successfully updated.'));
+		
     $this->addCategory($category = $this->randomName(16), implode(',', array($recipients[0], $recipients[1])), '', FALSE);
     $this->assertRaw(t('Category %category has been added.', array('%category' => $category)), t('Category successfully added.'));
 
@@ -89,7 +94,6 @@
     $this->assertText($edit['contact_form_information'], t('Contact information displayed.'));
 
     // Submit contact form with invalid values.
-    $categories = $this->getCategories();
     $this->submitContact('', $recipients[0], $this->randomName(16), $categories[0], $this->randomName(64));
     $this->assertText(t('Your name field is required.'), t('Name required.'));
 
@@ -137,6 +141,24 @@
   }
 
   /**
+   * Update a category.
+   *
+   * @param string $category Name of category.
+   * @param string $recipients List of recipient e-mail addresses.
+   * @param string $reply Auto-reply text.
+   * @param boolean $selected Defautly selected.
+   */
+  function updateCategory($categories, $category, $recipients, $reply, $selected) {
+    $category_id = $categories[array_rand($categories)];
+    $edit = array();
+    $edit['category'] = $category;
+    $edit['recipients'] = $recipients;
+    $edit['reply'] = $reply;
+    $edit['selected'] = ($selected ? '1' : '0');
+    $this->drupalPost('admin/build/contact/edit/' . $category_id, $edit, t('Save'));
+  }
+
+  /**
    * Submit contact form.
    *
    * @param string $name Name.
