Updated usernames in tests

This commit is contained in:
Lukas Metzger 2018-04-05 14:53:56 +02:00
parent 0e6a90fa8f
commit 8262d53280
3 changed files with 21 additions and 7 deletions

View file

@ -218,7 +218,8 @@ CREATE TABLE `users` (
INSERT INTO `users` (`id`, `name`, `backend`, `type`, `password`) VALUES
(1, 'admin', 'native', 'admin', '$2y$10$9iIDHWgjY0pEsz8pZLXPx.gkMNDxTMzb7U0Um5hUGjKmUUHWQNXcW'),
(2, 'user', 'native', 'user', '$2y$10$MktCI4XcfD0FpIFSkxex6OVifnIw3Nqw6QJueWmjVte99wx6XGBoq');
(2, 'user', 'native', 'user', '$2y$10$MktCI4XcfD0FpIFSkxex6OVifnIw3Nqw6QJueWmjVte99wx6XGBoq'),
(3, 'configuser', 'config', 'user', NULL);
--
-- Indexes for dumped tables
@ -336,7 +337,7 @@ ALTER TABLE `tsigkeys`
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

View file

@ -23,11 +23,12 @@ return [
'prefix' => 'default',
'config' => null
],
'foo' => [
'config' => [
'plugin' => 'config',
'prefix' => 'foo',
'prefix' => 'config',
'config' => [
'admin' => '\$2y\$10\$u9ji0cGRpd/doYEF/AztkOP3qmaaDYOGXzs0PmnGbMF7sJYzODDbO'
'configuser' => '\$2y\$10\$twlIJ0hYeaHqMsiM7OdLr.4HkV6/EEQneDg9uZiU.l7yn1bpxSD1.',
'notindb' => '\$2y\$10\$z1dD1Q5u68l5iqEmqnOAVuoR5VWR77HUfxMUycJ9TdDG3H5dLZGVW'
]
]
]

View file

@ -54,8 +54,20 @@ test.run(async function () {
url: '/sessions',
method: 'post',
data: {
username: 'foo/admin',
password: 'admin'
username: 'config/configuser',
password: 'configuser'
}
});
assert.equal(res.status, 201, 'Status not valid');
//Try to login with prefix but no db entry
var res = await req({
url: '/sessions',
method: 'post',
data: {
username: 'config/notindb',
password: 'notindb'
}
});