<p dir="auto">Currently you create a closed note in tests like this:</p>
<div class="highlight highlight-source-ruby" dir="auto"><pre class="notranslate"><span class="pl-en">create</span><span class="pl-kos">(</span><span class="pl-pds">:note</span><span class="pl-kos">,</span> <span class="pl-pds">:status</span> <span class="pl-c1">=></span> <span class="pl-s">"closed"</span><span class="pl-kos">,</span> <span class="pl-pds">:closed_at</span> <span class="pl-c1">=></span> <span class="pl-v">Time</span><span class="pl-kos">.</span><span class="pl-en">now</span><span class="pl-kos">.</span><span class="pl-en">utc</span><span class="pl-kos">)</span></pre></div>
<p dir="auto">You have to remember to set <code class="notranslate">:closed_at</code>. There's code that assumes that closed notes have this time set. If omitted, it's going to be unset.</p>
<p dir="auto">Here I add the <code class="notranslate">:closed</code> trait to the note factory that will set <code class="notranslate">:closed_at</code> and also add a closing comment.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/openstreetmap/openstreetmap-website/pull/4459'>https://github.com/openstreetmap/openstreetmap-website/pull/4459</a></p>

<h4>Commit Summary</h4>
<ul>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/4459/commits/6272b041c6dd9c39cc7a23d6163651e74509da2b" class="commit-link">6272b04</a>  Add :closed trait to note factory</li>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/4459/commits/1efbdb2d6c6b0853087f12e50878bd64f9f02cda" class="commit-link">1efbdb2</a>  Add closed_by attribute to :closed note factory trait</li>
</ul>

<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/openstreetmap/openstreetmap-website/pull/4459/files">5 files</a>)</p>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4459/files#diff-b4cc80ae5a4279eef2a7494cb8c489220ce03acaf36932b2042247df9d316908">test/controllers/api/notes_controller_test.rb</a>
    (14)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4459/files#diff-b41a560e061b578bbf13158bf175036a9489241ab69f59137c44d57df9682fa7">test/controllers/notes_controller_test.rb</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4459/files#diff-e5faca18e5e52daf20d8ffd5f110da070f121d1a9d07794e08f4522ffe45c6a5">test/factories/notes.rb</a>
    (13)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4459/files#diff-b93fe6b2fae5309f99ba81772f10cf26c2d05ce9eb923b430a03de6121951964">test/models/note_test.rb</a>
    (12)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4459/files#diff-960e6e9200fa7ea5eed049f5de24d807cf7c7a4c0434875d23139ff261ddc0fe">test/system/note_comments_test.rb</a>
    (2)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/4459.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/4459.patch</a></li>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/4459.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/4459.diff</a></li>
</ul>

<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/4459">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLMOVOPWSWS5EF2NL6DYM7H65AVCNFSM6AAAAABBOG22MSVHI2DSMVQWIX3LMV43ASLTON2WKOZSGA3DOMBZGEZDMMQ">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLNC2PCEEJWZU333JKDYM7H65A5CNFSM6AAAAABBOG22MSWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHHWNKPHY.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/4459</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/4459",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/4459",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>