From 25b1ad4047e85d17293bbb7ae7d66ff62fd7c24b Mon Sep 17 00:00:00 2001 From: Molly Struve Date: Wed, 12 Feb 2020 16:32:38 -0500 Subject: [PATCH] Flaky Spec Try 2: Article Decorator properly handles Names (#6048) --- spec/decorators/article_decorator_spec.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/decorators/article_decorator_spec.rb b/spec/decorators/article_decorator_spec.rb index 288f03eb7..40929ec9b 100644 --- a/spec/decorators/article_decorator_spec.rb +++ b/spec/decorators/article_decorator_spec.rb @@ -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