# File lib/rspec/rails/mocks.rb, line 40def[](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 34defdestroyRSpec::Mocks.allow_message(self, :persisted?).and_return(false)
RSpec::Mocks.allow_message(self, :id).and_return(nil)
end
new_record?()click to toggle source
Returns the opposite of `persisted?`
# File lib/rspec/rails/mocks.rb, line 45defnew_record?!persisted?end