evansagge/mongoid-rspec — pull request #89 by anshulm (2012-12-26 19:53:43+00:00)
Title: Ensuring that the tests fail if a particular option is not present, while creating the index

This test(modified version of '//mongoid-rspec/spec/unit/indexes_spec.rb:6') should fail:

it { should have_index_for(title: 1).with_options(unique: true, test_background: true) }

e.g

index({ some_field: 1 }, { background: true })

Test:

it { should have_index_for(some_field: 1).with_options(unique: true, background: true) }

will fail now, with this change.

This is helpful because there will be a test failure, if someone accidentally removes some option from the index.