lib/matchers/document/have_index.rb in mongoid-minitest-0.0.3.1 vs lib/matchers/document/have_index.rb in mongoid-minitest-0.1.0

- old
+ new

@@ -8,13 +8,15 @@ end def matches?(subject) @klass = class_of(subject) - unless @klass.index_options[@field.to_sym] || @klass.index_options["#{@field}_id"] - @error = "no index for #{@field.inspect}" + @klass.index_options.each do |key, options| + unless key[@field.to_sym] || key["#{@field}_id"] + @error = "no index for #{@field.inspect}" - return false + return false + end end true end