Sha256: 975e48009cfb8de9bebf1bae5d058d6a74dc6617b03a2dfa35f425ccd998e6b5

Contents?: true

Size: 348 Bytes

Versions: 8

Compression:

Stored size: 348 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.index_information.detect { |index| index[0] == index_name }.present?
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
mongo_mapper-0.14.0 spec/support/matchers.rb
mongo_mapper-0.14.0.rc1 spec/support/matchers.rb
mark_mapper-0.0.6 spec/support/matchers.rb
mark_mapper-0.0.5 spec/support/matchers.rb
mark_mapper-0.0.4 spec/support/matchers.rb
mark_mapper-0.0.3 spec/support/matchers.rb
mark_mapper-0.0.2 spec/support/matchers.rb
mark_mapper-0.0.1 spec/support/matchers.rb