Flaky Spec Try 2: Article Decorator properly handles Names (#6048)
This commit is contained in:
parent
8a11872472
commit
25b1ad4047
1 changed files with 3 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue