1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-11 17:51:01 +00:00

Add integration tests for users

This commit is contained in:
Frédéric Guillot 2017-11-25 12:44:32 -08:00
parent 142e8b3e0c
commit ec0f642d5d
11 changed files with 267 additions and 33 deletions

View file

@ -4,6 +4,8 @@
package model
import "github.com/miniflux/miniflux2/errors"
// GetThemes returns the list of available themes.
func GetThemes() map[string]string {
return map[string]string{
@ -11,3 +13,14 @@ func GetThemes() map[string]string {
"black": "Black",
}
}
// ValidateTheme validates theme value.
func ValidateTheme(theme string) error {
for key := range GetThemes() {
if key == theme {
return nil
}
}
return errors.NewLocalizedError("Invalid theme.")
}