Fix selectors in answerbox comments view spec

This commit is contained in:
Andreas Nedbal 2024-02-28 22:16:54 +01:00 committed by Andreas Nedbal
parent 22886934db
commit c864c14355
1 changed files with 2 additions and 2 deletions

View File

@ -40,7 +40,7 @@ describe "answerbox/_comments.html.haml", type: :view do
it "shows the delete option" do it "shows the delete option" do
html = Nokogiri::HTML.parse(rendered) html = Nokogiri::HTML.parse(rendered)
selector = %(li.comment[data-comment-id="#{comment.id}"] .btn-group a[data-action="ab-comment-destroy"]) selector = %(li.comment[data-comment-id="#{comment.id}"] .dropdown a[data-action="ab-comment-destroy"])
element = html.css(selector) element = html.css(selector)
expect(element).to_not be_nil expect(element).to_not be_nil
expect(element.text.strip).to eq("Delete") expect(element.text.strip).to eq("Delete")
@ -57,7 +57,7 @@ describe "answerbox/_comments.html.haml", type: :view do
it "does not show the delete option" do it "does not show the delete option" do
html = Nokogiri::HTML.parse(rendered) html = Nokogiri::HTML.parse(rendered)
selector = %(li.comment[data-comment-id="#{comment.id}"] .btn-group a[data-action="ab-comment-destroy"]) selector = %(li.comment[data-comment-id="#{comment.id}"] .dropdown a[data-action="ab-comment-destroy"])
expect(html.css(selector)).to be_empty expect(html.css(selector)).to be_empty
end end
end end