Flaky Spec Try 2: Article Decorator properly handles Names (#6048)

This commit is contained in:
Molly Struve 2020-02-12 16:32:38 -05:00 committed by GitHub
parent 8a11872472
commit 25b1ad4047
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -57,7 +57,9 @@ RSpec.describe ArticleDecorator, type: :decorator do
it "creates proper description when it is not present and body is not present and long, and tags are present" do
body_markdown = "---\ntitle: Title\npublished: false\ndescription:\ntags: heytag\n---\n\n"
created_article = create_article(body_markdown: body_markdown)
expect(created_article.description_and_tags).to eq("A post by #{created_article.user.name.delete('.')}. Tagged with heytag.")
parsed_post_by_string = "A post by #{created_article.user.name}"
parsed_post_by_string += "." unless created_article.user.name.end_with?(".")
expect(created_article.description_and_tags).to eq("#{parsed_post_by_string} Tagged with heytag.")
end
end
end