1
0
mirror of https://github.com/mxpv/podsync.git synced 2024-05-11 05:55:04 +00:00

Implement login via Patreon

This commit is contained in:
Maksym Pavlenko
2017-08-20 16:01:30 -07:00
parent a243cef707
commit c0e8f7aa8c
8 changed files with 167 additions and 48 deletions

View File

@@ -15,6 +15,7 @@ vimeoApiKey: "2"
patreonClientId: "3"
patreonSecret: "4"
postgresConnectionUrl: "5"
cookieSecret: "6"
`
func TestReadYaml(t *testing.T) {
@@ -32,6 +33,7 @@ func TestReadYaml(t *testing.T) {
require.Equal(t, "3", cfg.PatreonClientId)
require.Equal(t, "4", cfg.PatreonSecret)
require.Equal(t, "5", cfg.PostgresConnectionURL)
require.Equal(t, "6", cfg.CookieSecret)
}
func TestReadEnv(t *testing.T) {
@@ -43,6 +45,7 @@ func TestReadEnv(t *testing.T) {
os.Setenv("PATREON_CLIENT_ID", "33")
os.Setenv("PATREON_SECRET", "44")
os.Setenv("POSTGRES_CONNECTION_URL", "55")
os.Setenv("COOKIE_SECRET", "66")
cfg, err := ReadConfiguration()
require.NoError(t, err)
@@ -51,4 +54,6 @@ func TestReadEnv(t *testing.T) {
require.Equal(t, "22", cfg.VimeoApiKey)
require.Equal(t, "33", cfg.PatreonClientId)
require.Equal(t, "44", cfg.PatreonSecret)
require.Equal(t, "55", cfg.PostgresConnectionURL)
require.Equal(t, "66", cfg.CookieSecret)
}