docbrown/spec/views/comments/_comment.html.erb_spec.rb
ludwiczakpawel 70706d0a62
Comments UI update (#11283)
* tooltips 1.0.1

* tooltips 1.0.1

* init

* .

* drop not needed files

* .

* init

* init

* .

* comments

* border

* missing bits

* build comment JS

* .

* .

* specs

* sloan avatar fix

* bunch of fixes

* specs and fixes

* specs

* .

* swap order of links

* contrast

* js for dropdown

* icons

* op-author

* three dots icon

* reverts

* test: capybara- make sure that we click the dropdown before clicking on edit

* permalink --> link

* tiny fixes

* aria-label on form

* proper alt on user's avatar

* aria has popup

* use UL > LI instead of DIV

* add aria-labels to dropdown items

* another aria-label

* better links: nav

* contrast

Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
2020-11-18 18:21:19 -05:00

22 lines
893 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(SiteConfig).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(/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