module Mongoid::Matchers

Public Instance Methods

allow_mass_assignment_of(value) click to toggle source

Ensures that the attribute can be set on mass update.

it { should_not allow_mass_assignment_of(:password) }
it { should allow_mass_assignment_of(:first_name) }

In Rails 3.1 you can check role as well:

it { should allow_mass_assignment_of(:first_name).as(:admin) }
# File lib/matchers/allow_mass_assignment.rb, line 98
def allow_mass_assignment_of(value)
  AllowMassAssignmentOfMatcher.new(value)
end
be_dynamic_document() click to toggle source
# File lib/matchers/be_dynamic_document.rb, line 3
def be_dynamic_document
  BeDynamicDocument.new
end
be_mongoid_document() click to toggle source
# File lib/matchers/be_mongoid_document.rb, line 3
def be_mongoid_document
  BeMongoidDocument.new
end
be_stored_in(options) click to toggle source
# File lib/matchers/be_stored_in.rb, line 3
def be_stored_in(options)
  BeStoredIn.new(options)
end
have_field(*args) click to toggle source
# File lib/matchers/have_field.rb, line 85
def have_field(*args)
  HaveField.new(*args)
end
Also aliased as: have_fields
have_fields(*args)
Alias for: have_field
have_index_for(index_key) click to toggle source
# File lib/matchers/indexes/v3/have_index_for.rb, line 3
def have_index_for(index_key)
  HaveIndexFor.new(index_key)
end
have_timestamps() click to toggle source
# File lib/matchers/have_timestamps.rb, line 3
def have_timestamps
  HaveTimestamps.new
end