title: How to create temporal table in rspec test
body: <p>I have a model Address and one module Addressable injecting a *belongs_to :address* relation for AR classes which include this module Addressable.</p>
  
  <p>I want to test that class that include this module have this relation.</p>
  
  <p>class Address:</p>
  
  <pre><code>class Address &lt; ActiveRecord::Base
    attr_accessible :street, :zip
  end
  </code></pre>
  
  <p>module Addressable</p>
  
  <pre><code>module Addressable
    def self.included(base)
      base.class_eval &lt;&lt;-CLASS_METHODS
            belongs_to :address
            validates :address, presence: true
      CLASS_METHODS
    end
  end
  </code></pre>
  
  <p>Test code:</p>
  
  <pre><code>require 'spec_helper'
  describe 'Addressable' do
  
    subject do
      class OtherModel &lt; ActiveRecord::Base
        include Addressable
      end
    end
  
    before(:all) do
      connection = ActiveRecord::Base.connection
      connection.create_table :othermodels do |t|
        t.references :address
      end
    end
  
    after(:all) do
      connection.drop_table :othermodels
    end
  
    it "should validate presence of address"do
      should validate_presence_of(:address)
    end
  
    it "should belongs to address" do
  should belong_to :continent
    end
  end
  </code></pre>
  
  <p>My test fail with</p>
  
  <pre><code> 1) Addressable should validate presence of address
     Failure/Error: should validate_presence_of(:address)
     NoMethodError:
       undefined method `address=' for OtherModel(Table doesn't exist):Class
  </code></pre>
  
  <p>I supose that the before(:all) is not doing it's work. How can I create this table.</p>