title: Rspec Model Association Test not working on model subclass
body: <pre><code>class Proofreader &lt; Role
  
    has_many :proofreading_jobs,   :class_name =&gt; 'ProofreadingJob',   :foreign_key =&gt; 'proofreader_id'
  
  end
  
  class ProofreadingJob &lt; ApplicationRecord
  
    belongs_to :proofreader, class_name: 'Role', foreign_key: :proofreader_id, optional: true
    belongs_to :client,      class_name: 'Role', foreign_key: :client_id
    end
  
  class Role &lt; ApplicationRecord
  
    belongs_to :user
  
  end
  
  proofreaders factory:
  
      FactoryBot.define do
        factory :proofreader do
          type { 'Proofreader'}
          hourly_rate { 15 }
          association :user, factory: :employee_user
  
          factory :proofreader_with_work_events do
  
            after :create do |proofreader|
              create(:user_event, :recurring_mwf, user: proofreader.user)
            end
  
          end
        end
      end
  </code></pre>
  
  <p>spec/model_roles/proofreader_spec.rb</p>
  
  <pre><code>RSpec.describe 'Proofreader', type: :model do
  
    describe "Associations" do
      it { should have_many(:proofreading_jobs) }
    end
  
  end
  </code></pre>
  
  <p>Test fails with:</p>
  
  <pre><code>Failure/Error: it { should have_many(:proofreading_jobs) }
         expected Associations to respond to `has_many?`
  </code></pre>
  
  <p>Clearly the class ProofreadingJob has the association there. How can I write this test so it passes?</p>