Skip to content

Commit f80eb03

Browse files
committed
Updat messages related to a new logic
1 parent 1f66421 commit f80eb03

File tree

2 files changed

+5
-1
lines changed
  • app/code/Magento/Newsletter/Controller/Manage
  • dev/tests/integration/testsuite/Magento/Newsletter/Controller

2 files changed

+5
-1
lines changed

app/code/Magento/Newsletter/Controller/Manage/Save.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ public function execute()
9696
->unsubscribeCustomerById($customerId);
9797
$this->messageManager->addSuccess(__('We removed the subscription.'));
9898
}
99+
}else{
100+
$this->messageManager->addSuccess(__('We updated the subscription.'));
101+
return;
99102
}
100103
} catch (\Exception $e) {
101104
$this->messageManager->addError(__('Something went wrong while saving your subscription.'));

dev/tests/integration/testsuite/Magento/Newsletter/Controller/ManageTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ public function testSaveAction()
6868
*/
6969
public function testSaveActionRemoveSubscription()
7070
{
71+
7172
$this->getRequest()
7273
->setParam('form_key', 'formKey')
7374
->setParam('is_subscribed', '0');
@@ -84,7 +85,7 @@ public function testSaveActionRemoveSubscription()
8485
* Check that success message
8586
*/
8687
$this->assertSessionMessages(
87-
$this->equalTo(['We removed the subscription.']),
88+
$this->equalTo(['We updated the subscription.']),
8889
\Magento\Framework\Message\MessageInterface::TYPE_SUCCESS
8990
);
9091
}

0 commit comments

Comments
 (0)