Sha256: 437594c18135fc3f51fdb80cb3c7ed9fb23a3cf0645cbe609da3e49da4f889c1

Contents?: true

Size: 312 Bytes

Versions: 9

Compression:

Stored size: 312 Bytes

Contents

RSpec::Matchers.define :have_error_on do |*args|
  match do |model|
    field = args.dup.shift
    error_messages = args

    model.valid?
    model.errors[field].any?
  end
end

RSpec::Matchers.define :have_index do |index_name|
  match do |model|
    model.collection.indexes.get(index_name).present?
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
mongo_mapper-0.17.0 spec/support/matchers.rb
mongo_mapper-0.16.0 spec/support/matchers.rb
mongo_mapper-0.15.6 spec/support/matchers.rb
mongo_mapper-0.15.5 spec/support/matchers.rb
mongo_mapper-0.15.4 spec/support/matchers.rb
mongo_mapper-0.15.3 spec/support/matchers.rb
mongo_mapper-0.15.2 spec/support/matchers.rb
mongo_mapper-0.15.1 spec/support/matchers.rb
mongo_mapper-0.15.0 spec/support/matchers.rb