<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -0,0 +1,130 @@
+require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
+
+module &lt;%= class_name %&gt;Attributes
+  def valid_attributes
+    {
+      :mailer_method   =&gt; &quot;send_some_&lt;%= object_name %&gt;&quot;,
+      :attempts        =&gt; 0,
+      :last_attempt_at =&gt; nil,
+      :created_at      =&gt; Date.parse(&quot;2009-02-11&quot;),
+      :updated_at      =&gt; Date.parse(&quot;2009-02-11&quot;)
+    }
+  end
+end
+
+describe &lt;%= class_name %&gt;sController do
+
+  include &lt;%= class_name %&gt;Attributes
+
+  before do
+    @&lt;%= object_name %&gt; = &lt;%= class_name %&gt;.create!(valid_attributes)
+    @&lt;%= object_name %&gt;.stub!(:deliver =&gt; true)
+
+    &lt;%= class_name %&gt;.stub!({
+      :find        =&gt; @&lt;%= object_name %&gt;,
+      :all         =&gt; [@&lt;%= object_name %&gt;],
+      :deliver_all =&gt; true,
+      :destroy_all =&gt; true
+    })
+
+    request.env[&quot;HTTP_REFERER&quot;] = &quot;/somewhere&quot;
+    @back = &quot;http://test.host/somewhere&quot;
+  end
+
+  describe &quot;GET :index&quot; do
+    def do_get
+      get :index
+    end
+
+    it &quot;should find all &lt;%= object_name %&gt;s&quot; do
+      &lt;%= class_name %&gt;.should_receive(:all)
+      do_get
+    end
+
+    it &quot;should assign @&lt;%= object_name %&gt;s for the view&quot; do
+      do_get
+      assigns[:&lt;%= object_name %&gt;s].should == [@&lt;%= object_name %&gt;]
+    end
+
+  end
+
+  describe &quot;GET :deliver&quot; do
+    before do
+      &lt;%= class_name %&gt;.stub!(:find).with(&quot;1&quot;).and_return(@&lt;%= object_name %&gt;)
+    end
+
+    def do_get
+      get :deliver, :id =&gt; &quot;1&quot;
+    end
+
+    it &quot;should find the &lt;%= object_name %&gt; in question&quot; do
+      &lt;%= class_name %&gt;.should_receive(:find).with(&quot;1&quot;).and_return(@&lt;%= object_name %&gt;)
+      do_get
+    end
+
+    it &quot;should deliver the &lt;%= object_name %&gt;&quot; do
+      @&lt;%= object_name %&gt;.should_receive(:deliver)
+      do_get
+    end
+
+    it &quot;should redirect back&quot; do
+      do_get
+      response.should redirect_to(@back)
+    end
+
+  end
+
+  describe &quot;GET :deliver_all&quot; do
+    def do_get
+      get :deliver_all
+    end
+
+    it &quot;should deliver all &lt;%= object_name %&gt;s&quot; do
+      &lt;%= class_name %&gt;.should_receive(:deliver_all)
+      do_get
+    end
+
+    it &quot;should redirect back&quot; do
+      do_get
+      response.should redirect_to(@back)
+    end
+
+  end
+
+  describe &quot;DELETE :destroy&quot; do
+
+    def do_destroy
+      delete :destroy, :id =&gt; &quot;1&quot;
+    end
+
+    it &quot;should destroy the &lt;%= object_name %&gt;&quot; do
+      @&lt;%= object_name %&gt;.should_receive(:destroy)
+      do_destroy
+    end
+
+    it &quot;should redirect back&quot; do
+      do_destroy
+      response.should redirect_to(@back)
+    end
+
+  end
+
+  describe &quot;DELETE :destroy_all&quot; do
+
+    def do_destroy
+      delete :destroy_all
+    end
+
+    it &quot;should destroy all &lt;%= object_name %&gt;&quot; do
+      &lt;%= class_name %&gt;.should_receive(:destroy_all)
+      do_destroy
+    end
+
+    it &quot;should redirect back&quot; do
+      do_destroy
+      response.should redirect_to(@back)
+    end
+
+  end
+
+end</diff>
      <filename>generators/mq/templates/spec/emails_controller_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>3f73dc7fcfc4bdf4a325bf4a6cd367cd3d1434c8</id>
    </parent>
  </parents>
  <author>
    <name>Matt Darby</name>
    <email>matt@matt-darby.com</email>
  </author>
  <url>http://github.com/mdarby/mq/commit/390d0b8724da52f8f65c36fa86eb8882c4a36668</url>
  <id>390d0b8724da52f8f65c36fa86eb8882c4a36668</id>
  <committed-date>2009-10-18T07:40:25-07:00</committed-date>
  <authored-date>2009-10-18T07:40:25-07:00</authored-date>
  <message>Added long forgotten spec</message>
  <tree>95f0ea8fd7d9d7806d1271d3479f9638510ad0dc</tree>
  <committer>
    <name>Matt Darby</name>
    <email>matt@matt-darby.com</email>
  </committer>
</commit>
