Stubs `persisted?` to return false and `id` to return nil @return self
# File lib/rspec/rails/mocks.rb, line 14 def as_new_record self.stub(:persisted?) { false } self.stub(:id) { nil } self end
Returns true by default. Override with a stub.
# File lib/rspec/rails/mocks.rb, line 21 def persisted? true end
Returns false for names matching /_before_type_cast$/, otherwise delegates to super.
# File lib/rspec/rails/mocks.rb, line 27 def respond_to?(message, include_private=false) message.to_s =~ /_before_type_cast$/ ? false : super end
[Validate]
Generated with the Darkfish Rdoc Generator 2.