title: Rails & RSpec - Testing Concerns class methods
body: <p>I have the following (simplified) Rails Concern:</p>
  
  <pre><code>module HasTerms
    extend ActiveSupport::Concern
  
    module ClassMethods
      def optional_agreement
        # Attributes
        #----------------------------------------------------------------------------
        attr_accessible :agrees_to_terms
      end
  
      def required_agreement
        # Attributes
        #----------------------------------------------------------------------------
        attr_accessible :agrees_to_terms
  
        # Validations
        #----------------------------------------------------------------------------
        validates :agrees_to_terms, :acceptance =&gt; true, :allow_nil =&gt; :false, :on =&gt; :create
      end
    end
  end
  </code></pre>
  
  <p>I can't figure out a good way to test this module in RSpec however - if I just create a dummy class, I get active record errors when I try to check that the validations are working.  Has anyone else faced this problem?</p>