How do I test a unique index?

http://rails.rubyonrails.org/classes/ActiveRecord/Validations/ClassMethods.html#M000816

"It can also validate whether the value of the specified attributes
are unique based on multiple scope parameters. For example, making
sure that a teacher can only be on the schedule once per semester for
a particular class."

validates_uniqueness_of :payment_number, :scope => :loan_id