<p>So having read rather too many rake tasks, and actually tried the instructions out, here's the story...</p>

<p>As given the instruction correctly configure the dev database, and dump it's schema (because migrate does that when it completes) but then then suggest running <code>rake test</code> and the problem is that when you do that, with the test database still empty, this is what you see:</p>

<pre><code>rake aborted!
ActiveRecord::PendingMigrationError: 

Migrations are pending. To resolve this issue, run:

    bin/rake db:migrate RAILS_ENV=test

...
</code></pre>

<p>But of course if you actually do what it suggests and migrate the test database then the extra steps like btree_gist and the 3GL functions will be missing from the test database.</p>

<p>In fact the correct thing to do at that point is to run <code>rake db:test:prepare</code> to load the schema into the test database, or just <code>rake test:db</code> which will reset the database before running the tests.</p>

<p>I suspect that in the past resetting the database before running the tests was the default, but that at some point that changed.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/openstreetmap/openstreetmap-website/issues/878#issuecomment-193796852">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABWnLWuNpG5jxpKmjJ3xnX_zGTuBUV-_ks5prYKMgaJpZM4DVy68.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/openstreetmap/openstreetmap-website/issues/878#issuecomment-193796852"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>