module Shoulda::ActiveRecord::Matchers
def have_db_column(column)
with_options(:precision => 10, :scale => 2) }
of_type(:decimal).
it { should have_db_column(:salary).
it { should_not have_db_column(:admin).of_type(:boolean) }
Examples:
(:default, :null, :limit, :precision, :scale)
* with_options - same options available in migrations
* of_type - db column type (:integer, :string, etc.)
Options:
Ensures the database column exists.
def have_db_column(column) HaveDbColumnMatcher.new(:have_db_column, column) end