<commit_before>{-# LANGUAGE OverloadedStrings #-}
module Feature.Rss
    ( rssSpecs
    ) where

import TestImport
import Helper.DB.SetupTeardown
import Factory.Article

rssSpecs :: Spec
rssSpecs =
  ydescribe "GET /blog/feed" $ do
    ydescribe "feed empty" $ do
      yit "should be notFound" $ do
        get BlogFeedR
        statusIs 404
    ydescribe "feed can read when article is not Draft" $ do
      yit "should be Found" $ withDeleteArticleTable $ do
        let slug = "testSlug"
        insertArticleTable slug
        --when blog has article, one can get BlogFeedR
        get BlogFeedR
        statusIs 200<commit_msg>add additional draft rss spec<commit_after>{-# LANGUAGE OverloadedStrings #-}
module Feature.Rss
    ( rssSpecs
    ) where

import TestImport
import Helper.DB.SetupTeardown
import Factory.Article

rssSpecs :: Spec
rssSpecs =
  ydescribe "GET /blog/feed" $ do
    ydescribe "feed empty" $ do
      yit "should be notFound" $ do
        get BlogFeedR
        statusIs 404
    ydescribe "blog has only draft article" $ do
      yit "should be notFound" $ withDeleteArticleTable $ do
        let slug = "draftSlug"
        insertDraftArticleTable slug
        get BlogFeedR
        statusIs 404
    ydescribe "feed can read when article is not Draft" $ do
      yit "should be Found" $ withDeleteArticleTable $ do
        let slug = "testSlug"
        insertArticleTable slug
        --when blog has article, one can get BlogFeedR
        get BlogFeedR
        statusIs 200
{'fraction_non_alphanumeric': 0.06254158349966733, 'fraction_numerical': 0.00998003992015968, 'mean_word_length': 2.5555555555555554, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6471395', 'n_tokens_mistral': 481, 'n_tokens_neox': 442, 'n_words': 157}