* Rename SiteConfig * More renaming * Update spec * Update mandatory settings mapping * More renaming * e2e test fixes * You have a rename, and you have a rename * Spec fix * More changes * Temporarily disable specs * After-merge update * Undo rename for migration * undo rename of DUS * Fix DUS * Fix merge problem * Remove redundant DUS * Fix specs * Remove unused code * Change wrong class name * More cleanup * Re-add missing values to constant * Fix constant * Fix spec * Remove obsolete fields * Add accidentally removed field * Update spec * Move methods from Settings::General to ForemInstance * Remove unneeded model * Change mentions of 'site config'
22 lines
939 B
Ruby
22 lines
939 B
Ruby
require "rails_helper"
|
|
|
|
RSpec.describe "rendering locals in a partial", type: :view do
|
|
context "when comment is low-quality" do
|
|
it "renders the comment with low-quality marker" do
|
|
allow(Settings::General).to receive(:mascot_image_url).and_return("https://i.imgur.com/fKYKgo4.png")
|
|
comment = build_stubbed(:comment, processed_html: "hi", score: CommentDecorator::LOW_QUALITY_THRESHOLD - 100)
|
|
article = build_stubbed(:article)
|
|
|
|
render "comments/comment",
|
|
comment: comment,
|
|
commentable: article,
|
|
is_view_root: true,
|
|
is_childless: true,
|
|
subtree_html: ""
|
|
|
|
expect(rendered).to match(/crayons-notice crayons-notice--warning low-quality-comment-marker/)
|
|
.and match(%r{Comment marked as low quality/non-constructive by the community.})
|
|
expect(rendered).to have_link "View Code of Conduct", href: "/code-of-conduct"
|
|
end
|
|
end
|
|
end
|