<p></p>
<p dir="auto">But do you want test like this that check that there's a form with <code class="notranslate">action='#'</code> inside some unspecified <code class="notranslate">div</code>?</p>
<div class="highlight highlight-source-ruby" dir="auto"><pre class="notranslate"> <span class="pl-en">assert_select</span> <span class="pl-s">"div#content"</span> <span class="pl-k">do</span>
<span class="pl-en">assert_select</span> <span class="pl-s">"div#sidebar"</span> <span class="pl-k">do</span>
<span class="pl-en">assert_select</span> <span class="pl-s">"div#sidebar_content"</span> <span class="pl-k">do</span>
<span class="pl-en">assert_select</span> <span class="pl-s">"div"</span> <span class="pl-k">do</span>
<span class="pl-en">assert_select</span> <span class="pl-s">"form[action='#']"</span> <span class="pl-k">do</span>
<span class="pl-en">assert_select</span> <span class="pl-s">"textarea[name=text]"</span>
<span class="pl-k">end</span>
<span class="pl-k">end</span>
<span class="pl-k">end</span>
<span class="pl-k">end</span>
<span class="pl-k">end</span></pre></div>
<p dir="auto">The exact structure is not important and I change it here anyway. The important thing is that it is inside the sidebar.</p>
<p dir="auto">How about tests like this?</p>
<div class="highlight highlight-source-ruby" dir="auto"><pre class="notranslate"> <span class="pl-en">within_sidebar</span> <span class="pl-k">do</span>
<span class="pl-en">assert_no_button</span> <span class="pl-s">"Comment"</span>
<span class="pl-en">assert_text</span> <span class="pl-s">"Changeset still open"</span>
<span class="pl-k">end</span></pre></div>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4463#issuecomment-1882987103">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLPBONR76GEEUWDWBTLYNUZ65AVCNFSM6AAAAABBRUCPACVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBSHE4DOMJQGM">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLL4MOJF7ABGRAJJGKDYNUZ65A5CNFSM6AAAAABBRUCPACWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTQHQNF6.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/4463/c1882987103</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/4463#issuecomment-1882987103",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/4463#issuecomment-1882987103",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>