From 03c6dcbd865e2af2db5db150189504bfa493ae2e Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Sun, 15 Nov 2015 18:18:02 -0800 Subject: PLT-975 adding perm deletes --- store/sql_oauth_store_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'store/sql_oauth_store_test.go') diff --git a/store/sql_oauth_store_test.go b/store/sql_oauth_store_test.go index 3f05f1c92..2a9aad1b3 100644 --- a/store/sql_oauth_store_test.go +++ b/store/sql_oauth_store_test.go @@ -180,3 +180,17 @@ func TestOAuthStoreRemoveAuthData(t *testing.T) { t.Fatal("should have errored - auth code removed") } } + +func TestOAuthStoreRemoveAuthDataByUserId(t *testing.T) { + Setup() + + a1 := model.AuthData{} + a1.ClientId = model.NewId() + a1.UserId = model.NewId() + a1.Code = model.NewId() + Must(store.OAuth().SaveAuthData(&a1)) + + if err := (<-store.OAuth().RemoveAuthDataByUserId(a1.UserId)).Err; err != nil { + t.Fatal(err) + } +} -- cgit v1.2.3-1-g7c22 From 6b2eabf6108e078bed8143e91c605dec5ccfafa6 Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Mon, 16 Nov 2015 17:12:49 -0800 Subject: Adding perm delete to cmd line --- store/sql_oauth_store_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'store/sql_oauth_store_test.go') diff --git a/store/sql_oauth_store_test.go b/store/sql_oauth_store_test.go index 2a9aad1b3..c3f6ea7ac 100644 --- a/store/sql_oauth_store_test.go +++ b/store/sql_oauth_store_test.go @@ -181,7 +181,7 @@ func TestOAuthStoreRemoveAuthData(t *testing.T) { } } -func TestOAuthStoreRemoveAuthDataByUserId(t *testing.T) { +func TestOAuthStoreRemoveAuthDataByUser(t *testing.T) { Setup() a1 := model.AuthData{} @@ -190,7 +190,7 @@ func TestOAuthStoreRemoveAuthDataByUserId(t *testing.T) { a1.Code = model.NewId() Must(store.OAuth().SaveAuthData(&a1)) - if err := (<-store.OAuth().RemoveAuthDataByUserId(a1.UserId)).Err; err != nil { + if err := (<-store.OAuth().PermanentDeleteAuthDataByUser(a1.UserId)).Err; err != nil { t.Fatal(err) } } -- cgit v1.2.3-1-g7c22