fix: arangodb get one queries
This commit is contained in:
@@ -14,8 +14,8 @@ func GetMetaInfo() model.Meta {
|
||||
IsGithubLoginEnabled: constants.GITHUB_CLIENT_ID != "" && constants.GOOGLE_CLIENT_SECRET != "",
|
||||
IsFacebookLoginEnabled: constants.FACEBOOK_CLIENT_ID != "" && constants.FACEBOOK_CLIENT_SECRET != "",
|
||||
IsTwitterLoginEnabled: constants.TWITTER_CLIENT_ID != "" && constants.TWITTER_CLIENT_SECRET != "",
|
||||
IsBasicAuthenticationEnabled: constants.DISABLE_BASIC_AUTHENTICATION != "true",
|
||||
IsEmailVerificationEnabled: constants.DISABLE_EMAIL_VERIFICATION != "true",
|
||||
IsMagicLoginEnabled: constants.DISABLE_MAGIC_LOGIN != "true" && constants.DISABLE_EMAIL_VERIFICATION != "true",
|
||||
IsBasicAuthenticationEnabled: !constants.DISABLE_BASIC_AUTHENTICATION,
|
||||
IsEmailVerificationEnabled: !constants.DISABLE_EMAIL_VERIFICATION,
|
||||
IsMagicLoginEnabled: !constants.DISABLE_MAGIC_LOGIN,
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,10 @@
|
||||
package utils
|
||||
|
||||
import "testing"
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestGetHostName(t *testing.T) {
|
||||
authorizer_url := "http://test.herokuapp.com"
|
||||
@@ -8,9 +12,7 @@ func TestGetHostName(t *testing.T) {
|
||||
got := GetHostName(authorizer_url)
|
||||
want := "test.herokuapp.com"
|
||||
|
||||
if got != want {
|
||||
t.Errorf("GetHostName Test failed got %s, wanted %s", got, want)
|
||||
}
|
||||
assert.Equal(t, got, want, "hostname should be equal")
|
||||
}
|
||||
|
||||
func TestGetDomainName(t *testing.T) {
|
||||
@@ -19,7 +21,5 @@ func TestGetDomainName(t *testing.T) {
|
||||
got := GetDomainName(authorizer_url)
|
||||
want := "herokuapp.com"
|
||||
|
||||
if got != want {
|
||||
t.Errorf("GetHostName Test failed got %q, wanted %q", got, want)
|
||||
}
|
||||
assert.Equal(t, got, want, "domain name should be equal")
|
||||
}
|
||||
|
@@ -1,21 +1,17 @@
|
||||
package utils
|
||||
|
||||
import "testing"
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestIsValidEmail(t *testing.T) {
|
||||
validEmail := "lakhan@gmail.com"
|
||||
invalidEmail1 := "lakhan"
|
||||
invalidEmail2 := "lakhan.me"
|
||||
|
||||
if IsValidEmail(validEmail) != true {
|
||||
t.Errorf("IsValidEmail Test failed got %t, wanted %t for %s", false, true, validEmail)
|
||||
}
|
||||
|
||||
if IsValidEmail(invalidEmail1) != false {
|
||||
t.Errorf("IsValidEmail Test failed got %t, wanted %t for %s", true, false, invalidEmail1)
|
||||
}
|
||||
|
||||
if IsValidEmail(invalidEmail2) != false {
|
||||
t.Errorf("IsValidEmail Test failed got %t, wanted %t for %s", true, false, invalidEmail2)
|
||||
}
|
||||
assert.True(t, IsValidEmail(validEmail), "it should be valid email")
|
||||
assert.False(t, IsValidEmail(invalidEmail1), "it should be invalid email")
|
||||
assert.False(t, IsValidEmail(invalidEmail2), "it should be invalid email")
|
||||
}
|
||||
|
Reference in New Issue
Block a user