<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -18,6 +18,12 @@ module Spec
         })
         m = mock(&quot;#{model_class.name}_#{id}&quot;, options_and_stubs)
         m.send(:__mock_proxy).instance_eval &lt;&lt;-CODE
+          def @target.as_new_record
+            self.stub!(:id).and_return nil
+            self.stub!(:to_param).and_return nil
+            self.stub!(:new_record?).and_return true
+            self
+          end
           def @target.is_a?(other)
             #{model_class}.ancestors.include?(other)
           end</diff>
      <filename>lib/spec/rails/mocks.rb</filename>
    </modified>
    <modified>
      <diff>@@ -65,3 +65,18 @@ describe &quot;mock_model as association&quot;, :type =&gt; :view do
       @real.mockable_model.should == @mock_model
   end
 end
+
+describe &quot;mock_model #as_new_record&quot; do
+  it &quot;should say it is a new record&quot; do
+    mock_model(MockableModel).as_new_record.should be_new_record
+  end
+
+  it &quot;should have a nil id&quot; do
+    mock_model(MockableModel).as_new_record.id.should be(nil)
+  end
+
+  it &quot;should have a nil to_param&quot; do
+    mock_model(MockableModel).as_new_record.to_param.should be(nil)
+  end
+end
+</diff>
      <filename>spec/rails/mocks/mock_model_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>7a9d2ce1b3c1f1ac314433f925a46b7bbfa05851</id>
    </parent>
  </parents>
  <author>
    <name>Zach Dennis</name>
    <email>zach.dennis@gmail.com</email>
  </author>
  <url>http://github.com/dchelimsky/rspec-rails/commit/3c59e0c75e1eaf6660a14654a56e1a419f5c5c85</url>
  <id>3c59e0c75e1eaf6660a14654a56e1a419f5c5c85</id>
  <committed-date>2008-08-11T04:37:59-07:00</committed-date>
  <authored-date>2008-08-07T08:03:55-07:00</authored-date>
  <message>Added mock_model#as_new_record functionality</message>
  <tree>75917c760669fedc56b73b3cba72f5b53d56c316</tree>
  <committer>
    <name>David Chelimsky</name>
    <email>david@chelimac.local</email>
  </committer>
</commit>
