Fixed the routes test

This commit is contained in:
Eduard Urbach 2018-12-07 16:20:10 +09:00
parent e4d49b7fb4
commit 4001f3dad8
3 changed files with 46 additions and 47 deletions

View File

@ -4,7 +4,7 @@ import (
"strings" "strings"
"github.com/aerogo/aero" "github.com/aerogo/aero"
"github.com/aerogo/session-store-nano" nanostore "github.com/aerogo/session-store-nano"
"github.com/animenotifier/arn" "github.com/animenotifier/arn"
"github.com/animenotifier/notify.moe/auth" "github.com/animenotifier/notify.moe/auth"
"github.com/animenotifier/notify.moe/middleware" "github.com/animenotifier/notify.moe/middleware"

View File

@ -15,11 +15,6 @@ import (
func Sequels(ctx *aero.Context) string { func Sequels(ctx *aero.Context) string {
nick := ctx.Get("nick") nick := ctx.Get("nick")
user := utils.GetUser(ctx) user := utils.GetUser(ctx)
if user == nil {
return ctx.Error(http.StatusUnauthorized, "Not logged in")
}
viewUser, err := arn.GetUserByNick(nick) viewUser, err := arn.GetUserByNick(nick)
if err != nil { if err != nil {

View File

@ -6,57 +6,57 @@ var routeTests = map[string][]string{
"/+Akyoto", "/+Akyoto",
}, },
"/user/:nick/characters/liked": []string{ // "/user/:nick/characters/liked": []string{
"/+Akyoto/characters/liked", // "/+Akyoto/characters/liked",
}, // },
"/user/:nick/forum/threads": []string{ // "/user/:nick/forum/threads": []string{
"/+Akyoto/forum/threads", // "/+Akyoto/forum/threads",
}, // },
"/user/:nick/forum/posts": []string{ // "/user/:nick/forum/posts": []string{
"/+Akyoto/forum/posts", // "/+Akyoto/forum/posts",
}, // },
"/user/:nick/soundtracks/added": []string{ // "/user/:nick/soundtracks/added": []string{
"/+Akyoto/soundtracks/added", // "/+Akyoto/soundtracks/added",
}, // },
"/user/:nick/soundtracks/added/from/:index": []string{ // "/user/:nick/soundtracks/added/from/:index": []string{
"/+Akyoto/soundtracks/added/from/3", // "/+Akyoto/soundtracks/added/from/3",
}, // },
"/user/:nick/soundtracks/liked": []string{ // "/user/:nick/soundtracks/liked": []string{
"/+Akyoto/soundtracks/liked", // "/+Akyoto/soundtracks/liked",
}, // },
"/user/:nick/soundtracks/liked/from/:index": []string{ // "/user/:nick/soundtracks/liked/from/:index": []string{
"/+Akyoto/soundtracks/liked/from/3", // "/+Akyoto/soundtracks/liked/from/3",
}, // },
"/user/:nick/quotes/added": []string{ // "/user/:nick/quotes/added": []string{
"/+Scott/quotes/added", // "/+Scott/quotes/added",
}, // },
"/user/:nick/quotes/added/from/:index": []string{ // "/user/:nick/quotes/added/from/:index": []string{
"/+Scott/quotes/added/from/3", // "/+Scott/quotes/added/from/3",
}, // },
"/user/:nick/quotes/liked": []string{ // "/user/:nick/quotes/liked": []string{
"/+Scott/quotes/liked", // "/+Scott/quotes/liked",
}, // },
"/user/:nick/quotes/liked/from/:index": []string{ // "/user/:nick/quotes/liked/from/:index": []string{
"/+Scott/quotes/liked/from/3", // "/+Scott/quotes/liked/from/3",
}, // },
"/user/:nick/followers": []string{ // "/user/:nick/followers": []string{
"/+Akyoto/followers", // "/+Akyoto/followers",
}, // },
"/user/:nick/stats": []string{ // "/user/:nick/stats": []string{
"/+Akyoto/stats", // "/+Akyoto/stats",
}, // },
"/user/:nick/animelist/anime/:id": []string{ "/user/:nick/animelist/anime/:id": []string{
"/+Akyoto/animelist/anime/74y2cFiiR", "/+Akyoto/animelist/anime/74y2cFiiR",
@ -102,8 +102,12 @@ var routeTests = map[string][]string{
"/+Akyoto/animelist/dropped/from/3", "/+Akyoto/animelist/dropped/from/3",
}, },
"/user/:nick/recommended/anime": []string{ "/user/:nick/anime/recommended": []string{
"/+Akyoto/recommended/anime", "/+Akyoto/anime/recommended",
},
"/user/:nick/anime/sequels": []string{
"/+Akyoto/anime/sequels",
}, },
"/users/country/:country": []string{ "/users/country/:country": []string{