diff --git a/core/modules/node/lib/Drupal/node/Plugin/Action/UnpublishByKeywordNode.php b/core/modules/node/lib/Drupal/node/Plugin/Action/UnpublishByKeywordNode.php
index d227c30..3e105fc 100644
--- a/core/modules/node/lib/Drupal/node/Plugin/Action/UnpublishByKeywordNode.php
+++ b/core/modules/node/lib/Drupal/node/Plugin/Action/UnpublishByKeywordNode.php
@@ -26,9 +26,10 @@ class UnpublishByKeywordNode extends ConfigurableActionBase {
    * {@inheritdoc}
    */
   public function execute($node = NULL) {
+    $build = node_view($node);
+    $text = drupal_render($build);
     foreach ($this->configuration['keywords'] as $keyword) {
-      $elements = node_view(clone $node);
-      if (strpos(drupal_render($elements), $keyword) !== FALSE || strpos($node->label(), $keyword) !== FALSE) {
+      if (strpos($text, $keyword) !== FALSE || strpos($node->label(), $keyword) !== FALSE) {
         $node->setPublished(FALSE);
         $node->save();
         break;
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeActionsTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeActionsTest.php
new file mode 100644
index 0000000..586f3d9
--- /dev/null
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeActionsTest.php
@@ -0,0 +1,75 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\node\Tests\NodeActionsTest.
+ */
+
+namespace Drupal\node\Tests;
+
+/**
+ * Tests actions provided by the Node module.
+ */
+class NodeActionsTest extends NodeTestBase {
+
+  /**
+   * A user with permission to bypass access content.
+   *
+   * @var \Drupal\user\UserInterface
+   */
+  protected $admin_user;
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = array('dblog', 'action');
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Node actions',
+      'description' => 'Test actions provided by the node module.',
+      'group' => 'Node',
+    );
+  }
+
+  public function setUp() {
+    parent::setUp();
+
+    // Create the admin user.
+    $this->admin_user = $this->drupalCreateUser(array('access content', 'bypass node access'));
+  }
+
+  /**
+   * Tests the unpublish node by keyword action.
+   */
+  function testNodeUnpublishByKeyword() {
+    $this->drupalLogin($this->admin_user);
+
+    $keyword_1 = $this->randomName();
+    $keyword_2 = $this->randomName();
+
+    $action = entity_create('action', array(
+      'id' => 'node_unpublish_by_keyword_action',
+      'label' => $this->randomName(),
+      'type' => 'node',
+      'configuration' => array(
+        'keywords' => array($keyword_1, $keyword_2),
+      ),
+      'plugin' => 'node_unpublish_by_keyword_action',
+    ));
+    $action->save();
+
+    $node = $this->drupalCreateNode(array(
+      'body' => array(array('format' => filter_default_format(), 'value' => $keyword_1))
+    ));
+    $node = node_load($node->id());
+
+    $this->assertTrue($node->status->value == NODE_PUBLISHED, 'The node status was set to published.');
+
+    $action->execute(array($node));
+    $this->assertTrue($node->status->value == NODE_NOT_PUBLISHED, 'The node status was set to not published.');
+  }
+
+}
