diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-04-12 16:29:42 -0400 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2017-04-12 16:29:42 -0400 |
commit | 8b8aa2ca3c803b26fb4a1ba5f249111739376494 (patch) | |
tree | 9fa13e99e60a9effc12bad964b13a3c23fab795e /store/sql_oauth_store_test.go | |
parent | 03502cf73b8513a40877b1ac5726523974661d4d (diff) | |
download | chat-8b8aa2ca3c803b26fb4a1ba5f249111739376494.tar.gz chat-8b8aa2ca3c803b26fb4a1ba5f249111739376494.tar.bz2 chat-8b8aa2ca3c803b26fb4a1ba5f249111739376494.zip |
Refactor OAuth 2.0 code into app layer (#6037)
Diffstat (limited to 'store/sql_oauth_store_test.go')
-rw-r--r-- | store/sql_oauth_store_test.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/store/sql_oauth_store_test.go b/store/sql_oauth_store_test.go index d0c04c53f..8c707562f 100644 --- a/store/sql_oauth_store_test.go +++ b/store/sql_oauth_store_test.go @@ -56,7 +56,7 @@ func TestOAuthStoreGetApp(t *testing.T) { } // Lets try and get the app from a user that hasn't created any apps - if result := (<-store.OAuth().GetAppByUser("fake0123456789abcderfgret1")); result.Err == nil { + if result := (<-store.OAuth().GetAppByUser("fake0123456789abcderfgret1", 0, 1000)); result.Err == nil { if len(result.Data.([]*model.OAuthApp)) > 0 { t.Fatal("Should have failed. Fake user hasn't created any apps") } @@ -64,11 +64,11 @@ func TestOAuthStoreGetApp(t *testing.T) { t.Fatal(result.Err) } - if err := (<-store.OAuth().GetAppByUser(a1.CreatorId)).Err; err != nil { + if err := (<-store.OAuth().GetAppByUser(a1.CreatorId, 0, 1000)).Err; err != nil { t.Fatal(err) } - if err := (<-store.OAuth().GetApps()).Err; err != nil { + if err := (<-store.OAuth().GetApps(0, 1000)).Err; err != nil { t.Fatal(err) } } @@ -324,7 +324,7 @@ func TestOAuthGetAuthorizedApps(t *testing.T) { Must(store.OAuth().SaveApp(&a1)) // Lets try and get an Authorized app for a user who hasn't authorized it - if result := <-store.OAuth().GetAuthorizedApps("fake0123456789abcderfgret1"); result.Err == nil { + if result := <-store.OAuth().GetAuthorizedApps("fake0123456789abcderfgret1", 0, 1000); result.Err == nil { if len(result.Data.([]*model.OAuthApp)) > 0 { t.Fatal("Should have failed. Fake user hasn't authorized the app") } @@ -340,7 +340,7 @@ func TestOAuthGetAuthorizedApps(t *testing.T) { p.Value = "true" Must(store.Preference().Save(&model.Preferences{p})) - if result := <-store.OAuth().GetAuthorizedApps(a1.CreatorId); result.Err != nil { + if result := <-store.OAuth().GetAuthorizedApps(a1.CreatorId, 0, 1000); result.Err != nil { t.Fatal(result.Err) } else { apps := result.Data.([]*model.OAuthApp) @@ -368,7 +368,7 @@ func TestOAuthGetAccessDataByUserForApp(t *testing.T) { p.Value = "true" Must(store.Preference().Save(&model.Preferences{p})) - if result := <-store.OAuth().GetAuthorizedApps(a1.CreatorId); result.Err != nil { + if result := <-store.OAuth().GetAuthorizedApps(a1.CreatorId, 0, 1000); result.Err != nil { t.Fatal(result.Err) } else { apps := result.Data.([]*model.OAuthApp) |