Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions spec/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,6 @@ cacheTests = do
wpCacheSet' (view wordpress ctxt) key (enc article1)
wpCacheGet' (view wordpress ctxt) key >>= shouldBe (Just (enc article1))

describe "wpCustom" $ do
it "should find single endpoint json after expire aggregates is called" $ do
ctxt <- initNoRequestWithCache
void $ wpCacheSet' (view wordpress ctxt) (EndpointKey "some-endpoint")
(enc article1)
void $ wpExpireAggregates' (view wordpress ctxt)
p <- wpCacheGet' (view wordpress ctxt) (EndpointKey "some-endpoint")
p `shouldBe` (Just $ enc article1)

queryTests :: Spec
queryTests =
describe "generate queries from <wpPosts>" $ do
Expand Down
7 changes: 5 additions & 2 deletions src/Web/Offset/Splices.hs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,10 @@ wpPostByPermalinkFill extraFields getURI wpLens = maybeFillChildrenWith' $
do uri <- getURI
let mperma = parsePermalink uri
case mperma of
Nothing -> return Nothing
Nothing -> do
w@Wordpress{..} <- use wpLens
liftIO $ wpLogger $ "unable to parse URI: " <> uri
return Nothing
Just (year, month, slug) ->
do res <- wpGetPost wpLens (PostByPermalinkKey year month slug)
case res of
Expand Down Expand Up @@ -300,7 +303,7 @@ findDict dicts (TaxSpecList tName tList) =
parsePermalink :: Text -> Maybe (Text, Text, Text)
parsePermalink = either (const Nothing) Just . A.parseOnly parser . T.reverse
where parser = do _ <- A.option ' ' (A.char '/')
guls <- A.many1 (A.letter <|> A.char '-')
guls <- A.many1 (A.letter <|> A.char '-' <|> A.digit)
_ <- A.char '/'
htnom <- A.count 2 A.digit
_ <- A.char '/'
Expand Down