module Shoulda::ActiveRecord::Matchers
def have_index(columns)
it { should have_index(:ssn).unique(true) }
it { should have_index([:commentable_type, :commentable_id]) }
it { should have_index(:age) }
Examples:
unique or not. Default = nil
constraint. Use nil if you don't care whether the index is
constraint. Use false to explicitly test for a non-unique
constraint. Use true to explicitly test for a unique
* unique - whether or not the index has a unique
Options:
columns.
Ensures that there are DB indices on the given columns or tuples of
def have_index(columns) HaveIndexMatcher.new(:have_index, columns) end