diff --git a/linkchecker.test b/linkchecker.test
index d4ea142..2907724 100644
--- a/linkchecker.test
+++ b/linkchecker.test
@@ -380,3 +380,76 @@ EOT;
     return db_query('SELECT COUNT(1) FROM {linkchecker_link}')->fetchField();
   }
 }
+
+/**
+ * Tests block updates
+ */
+class LinkCheckerBlockTest extends DrupalWebTestCase {
+
+  public static function getInfo() {
+    return array(
+      'name' => t('Block link checking and update tests'),
+      'description' => t('Test Link checker module block integration functionality.'),
+      'group' => 'Link checker',
+    );
+  }
+
+  public function setUp() {
+    parent::setUp('linkchecker');
+
+    $full_html_format = filter_format_load('full_html');
+    $permissions = array(
+      'administer blocks',
+      filter_permission_name($full_html_format),
+    );
+
+    $user = $this->drupalCreateUser($permissions);
+    $this->drupalLogin($user);
+
+  }
+
+  /**
+   * Tests block updates.
+   */
+  function testBlockUpdates() {
+    // Set the ignore response codes and behaviour.
+    variable_set('linkchecker_check_links_types', 0);
+    variable_set('linkchecker_scan_blocks', 1);
+    // Repair after 1 fail.
+    variable_set('linkchecker_action_status_code_301', 1);
+    // check after 1 day.
+    variable_set('linkchecker_check_links_interval', 86400);
+    variable_set('linkchecker_ignore_response_codes', '200
+206
+302
+304
+401
+403');
+
+    // Create block.
+    $this->drupalGet('admin/structure/block/add');
+    $edit = array(
+      'info' => 'dummy_block',
+      'body[value]' => 'something with <a href="http://google.com">google</a> which will 301 back to www',
+      'body[format]' => 'full_html'
+    );
+    $this->drupalPost(NULL, $edit, t('Save block'));
+
+    // Mark the last updated and fails to force an update.
+    db_update('linkchecker_link')
+      // 3 days ago.
+      ->fields(array(
+        'last_checked' => REQUEST_TIME - (3 * 86400),
+        'fail_count' => 2,
+      ))
+      ->execute();
+
+    // Run cron.
+    $this->cronRun();
+
+    // Load the block back up.
+    $block = block_custom_block_get(1);
+    // Verify that google.com rewritten to www.google.com.
+    $this->assertEqual($block['body'], 'something with <a href="http://www.google.com/">google</a> which will 301 back to www', format_string('Block body @body had link updated', array('@body' => $block['body'])));
+  }
+}
