Merge: - clients: fix rename

Close #1340

Squashed commit of the following:

commit 95f0291c681f98c29f4014b651c159d387301af4
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Thu Jan 9 18:56:23 2020 +0300

    add test

commit 293be277e245ff2f430e8c1e9ee3e82dc7da0995
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Thu Jan 9 16:04:36 2020 +0300

    - clients: fix rename
This commit is contained in:
Simon Zolin
2020-01-10 15:28:58 +03:00
parent 84b11ff7a5
commit 0cd25cf598
2 changed files with 7 additions and 2 deletions

View File

@@ -114,6 +114,7 @@ func TestClients(t *testing.T) {
c = Client{}
c, b = clients.Find("1.1.1.2")
assert.True(t, b && c.Name == "client1-renamed" && c.IDs[0] == "1.1.1.2" && c.UseOwnSettings)
assert.True(t, clients.list["client1"] == nil)
// failed remove - no such name
if clients.Del("client3") {