Skip to content
Snippets Groups Projects
Commit ea07f3c6 authored by Cari Spruiell's avatar Cari Spruiell
Browse files

Merge branches 'MAGETWO-6761-Incorrect-Url-When-Duplicate-3' and 'develop' of...

Merge branches 'MAGETWO-6761-Incorrect-Url-When-Duplicate-3' and 'develop' of github.scm.corp.ebay.com:magento-api/magento2ce into develop
parents 96bb665b 1bb2a3ca
Branches
No related merge requests found
......@@ -83,7 +83,7 @@ class Save extends \Magento\User\Controller\Adminhtml\User
{
$this->_getSession()->setUserData($data);
$arguments = $model->getId() ? ['user_id' => $model->getId()] : [];
$arguments = array_merge($arguments, ['_current' => true]);
$arguments = array_merge($arguments, ['_current' => true, 'active_tab' => '']);
$this->_redirect('adminhtml/*/edit', $arguments);
}
}
......@@ -95,6 +95,32 @@ class UserTest extends \Magento\Backend\Utility\Controller
$this->assertRedirect($this->stringContains('backend/admin/user/index/'));
}
/**
* @magentoDbIsolation enabled
* @magentoDataFixture Magento/User/_files/user_with_role.php
*/
public function testSaveActionDuplicateUser()
{
$this->getRequest()->setPostValue(
[
'username' => 'adminUser',
'email' => 'adminUser@example.com',
'firstname' => 'John',
'lastname' => 'Doe',
'password' => \Magento\TestFramework\Bootstrap::ADMIN_PASSWORD,
'password_confirmation' => \Magento\TestFramework\Bootstrap::ADMIN_PASSWORD,
\Magento\User\Block\User\Edit\Tab\Main::CURRENT_USER_PASSWORD_FIELD => Bootstrap::ADMIN_PASSWORD,
]
);
$this->dispatch('backend/admin/user/save/active_tab/main_section');
$this->assertSessionMessages(
$this->equalTo(['A user with the same user name or email already exists.']),
\Magento\Framework\Message\MessageInterface::TYPE_ERROR
);
$this->assertRedirect($this->stringContains('backend/admin/user/edit/'));
$this->assertRedirect($this->matchesRegularExpression('/^((?!active_tab).)*$/'));
}
/**
* @magentoDbIsolation enabled
* @dataProvider resetPasswordDataProvider
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment