How do I test a model with a polymorphic belongs_to association in isolation?
<p>Up front, I'm using:</p>

<ul>
<li>Ruby 2.3.1</li>
<li>Rails 5</li>
<li>rspec-rails 3.5</li>
</ul>

<p>I've set up a mountable Rails engine with a polymorphic model that I want to use in other engines. The model class looks like this:</p>



<pre class="lang-ruby prettyprint-override"><code>module Geo
  class Location &lt; ApplicationRecord
    belongs_to :locatable, polymorphic: true
  end
end
</code></pre>

<p>In my specs I'd like to make sure that I have a valid model, however, within the engine I have no other model that is associated with <code>Geo::Location</code>.</p>

<p>How can I set up a dummy class for testing validity (<code>belongs_to</code> require presence) or what are good testing strategies that you have used?</p>