Class/Module Index [+]

Quicksearch

RSpec::Rails::Mocks::ActiveRecordInstanceMethods

Public Instance Methods

[](key) click to toggle source

Transforms the key to a method and calls it.

# File lib/rspec/rails/mocks.rb, line 40
def [](key)
  send(key)
end
destroy() click to toggle source

Stubs `persisted?` to return `false` and `id` to return `nil`.

# File lib/rspec/rails/mocks.rb, line 34
def destroy
  self.stub(:persisted?) { false }
  self.stub(:id) { nil }
end
new_record?() click to toggle source

Returns the opposite of `persisted?`

# File lib/rspec/rails/mocks.rb, line 45
def new_record?
  !persisted?
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.