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