Skip to content

Commit

Permalink
Updat messages related to a new logic
Browse files Browse the repository at this point in the history
  • Loading branch information
nuzil authored and ihor-sviziev committed Jul 22, 2018
1 parent a36f791 commit 1b504cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/code/Magento/Newsletter/Controller/Manage/Save.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ public function execute()
->unsubscribeCustomerById($customerId);
$this->messageManager->addSuccess(__('We removed the subscription.'));
}
}else{
$this->messageManager->addSuccess(__('We updated the subscription.'));
return;
}
} catch (\Exception $e) {
$this->messageManager->addError(__('Something went wrong while saving your subscription.'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public function testSaveAction()
*/
public function testSaveActionRemoveSubscription()
{

$this->getRequest()
->setParam('form_key', 'formKey')
->setParam('is_subscribed', '0');
Expand All @@ -84,7 +85,7 @@ public function testSaveActionRemoveSubscription()
* Check that success message
*/
$this->assertSessionMessages(
$this->equalTo(['We removed the subscription.']),
$this->equalTo(['We updated the subscription.']),
\Magento\Framework\Message\MessageInterface::TYPE_SUCCESS
);
}
Expand Down

0 comments on commit 1b504cd

Please sign in to comment.