Index: tests/feedapi_error.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/feedapi/tests/Attic/feedapi_error.test,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 feedapi_error.test
--- tests/feedapi_error.test	20 Aug 2009 19:08:26 -0000	1.1.2.1
+++ tests/feedapi_error.test	21 Aug 2009 08:02:45 -0000
@@ -33,4 +33,45 @@ class FeedAPIErrorTestsCase extends Feed
     $node = db_result(db_query("SELECT nid FROM {feedapi} WHERE url = '%s'", $edit['feedapi[feedapi_url]']));
     $this->assertTrue(($node != FALSE), 'The inaccessible feed URL was inserted in the database.');
   }
+
+/**
+   * Feed add from
+   */
+  function testFeedAdd() {
+    $this->create_type(array_pop($this->get_parsers()));
+    $this->feedapi_user(TRUE);
+    $feed_urls = array();
+    $feed_urls[0] = $this->randomName();
+    $edit = array(
+      'feedapi[feedapi_url]' => $feed_urls[0],
+      'feedapi[refresh_time]' => 1,
+    );
+    $this->drupalPost('node/add/'. $this->info->type, $edit, 'Save');
+    $this->assertText(t('Title could not be retrieved from feed.'), 'Invalid URL results in correct warning.');
+    $feed_urls[1] = 'http://validbutnonexisting'. $this->randomName(25) .'.com/foo';
+    $edit = array(
+      'feedapi[feedapi_url]' => $feed_urls[1],
+      'feedapi[refresh_time]' => 1,
+    );
+    $this->drupalPost('node/add/'. $this->info->type, $edit, 'Save');
+    $this->assertText(t('Title could not be retrieved from feed.'), 'Non-existing URL results in correct warning.');
+    $this->drupalGet('admin/build/menu-customize/navigation');
+    $this->drupalGet('admin/content/node-type/'. $this->info->type);
+    $this->assertText('Is a feed content type');
+    // Turn off all the parsers for that feed
+    $edit = array(
+      'feedapi[parsers][parser_simplepie][enabled]' => FALSE,
+      'feedapi[parsers][parser_common_syndication][enabled]' => FALSE,
+    );
+    $this->drupalPost('admin/content/node-type/'. $this->info->type, $edit, 'Save content type');
+    $this->assertRaw(t('Using FeedAPI for this content-type requires at least one enabled parser.'), 'The lack of parsers was detected.');
+    $edit = array(
+      'feedapi[processors][feedapi_node][enabled]' => FALSE,
+    );
+    $this->drupalPost('admin/content/node-type/'. $this->info->type, $edit, 'Save content type');
+    $this->assertRaw(t('Using FeedAPI for this content-type requires at least one enabled processor.'), 'The lack of processors was detected.');
+
+    $num = db_result(db_query("SELECT COUNT(*) FROM {feedapi}"));
+    $this->assertEqual($num, 0, 'No feed was created during the test.');
+  }
 }
