<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>test/fixtures/zoos_controller_spec.rb.fixture</filename>
    </added>
    <added>
      <filename>test/fixtures/zoos_controller_spec_with_actions.rb.fixture</filename>
    </added>
    <added>
      <filename>test/fixtures/zoos_controller_test.rb.fixture</filename>
    </added>
    <added>
      <filename>test/fixtures/zoos_controller_test_with_actions.rb.fixture</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,15 @@
 require File.join(File.dirname(__FILE__), &quot;..&quot;, &quot;spec_helper.rb&quot;)
 
 describe &lt;%= @name_plural_camel %&gt;Controller do
-  
+  &lt;% @actions.each do |action| %&gt;
+  describe &quot;&lt;%= action %&gt;&quot; do
+    
+    it &quot;should get the &lt;%= action %&gt; action&quot; do
+      get &lt;%= @name_plural %&gt;_&lt;%= action %&gt;_url
+      response.should be_successful
+      response.body.should match(/&lt;%= @name_plural_camel %&gt;Controller#&lt;%= action %&gt;/)
+    end
+    
+  end
+  &lt;% end %&gt;
 end
\ No newline at end of file</diff>
      <filename>lib/mack/generators/controller_generator/templates/test/controllers/rspec.rb.template</filename>
    </modified>
    <modified>
      <diff>@@ -5,5 +5,11 @@ class &lt;%= @name_plural_camel %&gt;ControllerTest &lt; Test::Unit::TestCase
   def test_truth
     assert true
   end
-  
+  &lt;% @actions.each do |action| %&gt;
+  def test_&lt;%= action %&gt;
+    get &lt;%= @name_plural %&gt;_&lt;%= action %&gt;_url
+    assert response.successful?
+    assert_match /&lt;%= @name_plural_camel %&gt;Controller#&lt;%= action %&gt;/, response.body
+  end
+  &lt;% end %&gt;
 end
\ No newline at end of file</diff>
      <filename>lib/mack/generators/controller_generator/templates/test/controllers/test_case.rb.template</filename>
    </modified>
    <modified>
      <diff>@@ -12,10 +12,15 @@ describe ControllerGenerator do
   
   before(:each) do
     common_cleanup
+    @route_file_loc = File.join(Mack.root, &quot;config&quot;, &quot;routes.rb&quot;)
+    @original_route_file = File.read(@route_file_loc)
   end
   
   after(:each) do
     common_cleanup
+    File.open(@route_file_loc, &quot;w&quot;) do |f|
+      f.puts @original_route_file
+    end
   end
   
   it &quot;should require a name parameter&quot; do
@@ -36,6 +41,15 @@ describe ControllerGenerator do
     File.read(show).should match(/&lt;p&gt;You can find me in app\/views\/zoos\/show.html.erb&lt;\/p&gt;/)
   end
   
+  it &quot;should update the routes file if there are actions&quot; do
+    ControllerGenerator.run(&quot;name&quot; =&gt; &quot;zoo&quot;, &quot;actions&quot; =&gt; &quot;index,show&quot;)
+    File.read(@route_file_loc).should match(/  # Added by rake generate:controller name=zoo actions=index,show/)
+    File.read(@route_file_loc).should match(/  r.with_options\(:controller =&gt; :zoos\) do \|map\|/)
+    File.read(@route_file_loc).should match(/    map.zoos_index &quot;\/zoos&quot;, :action =&gt; :index/)
+    File.read(@route_file_loc).should match(/    map.zoos_show &quot;\/zoos\/show&quot;, :action =&gt; :show/)
+    File.read(@route_file_loc).should match(/  end # zoos/)
+  end
+  
   it &quot;should generate a controller&quot; do
     file = File.join(Mack.root, &quot;app&quot;, &quot;controllers&quot;, &quot;zoos_controller.rb&quot;)
     File.should_not be_exists(file)
@@ -55,20 +69,38 @@ describe ControllerGenerator do
   
   it &quot;should generate a Test::Unit::TestCase test if using the Test::Unit::TestCase framework&quot; do
     temp_app_config(&quot;mack::testing_framework&quot; =&gt; &quot;test_case&quot;) do
-      file = File.join(Mack.root, &quot;test&quot;, &quot;helpers&quot;, &quot;controllers&quot;, &quot;zoos_controller_helper_test.rb&quot;)
+      file = File.join(Mack.root, &quot;test&quot;, &quot;controllers&quot;, &quot;zoos_controller_test.rb&quot;)
       File.should_not be_exists(file)
       ControllerGenerator.run(&quot;name&quot; =&gt; &quot;zoo&quot;)
       File.should be_exists(file)
-      File.read(file).should == fixture(&quot;zoos_controller_helper_test.rb&quot;)
+      File.read(file).should == fixture(&quot;zoos_controller_test.rb&quot;)
     end
   end
   
   it &quot;should generate a RSpec test if using the RSpec framework&quot; do
-    file = File.join(Mack.root, &quot;test&quot;, &quot;helpers&quot;, &quot;controllers&quot;, &quot;zoos_controller_helper_spec.rb&quot;)
+    file = File.join(Mack.root, &quot;test&quot;, &quot;controllers&quot;, &quot;zoos_controller_spec.rb&quot;)
     File.should_not be_exists(file)
     ControllerGenerator.run(&quot;name&quot; =&gt; &quot;zoo&quot;)
     File.should be_exists(file)
-    File.read(file).should == fixture(&quot;zoos_controller_helper_spec.rb&quot;)
+    File.read(file).should == fixture(&quot;zoos_controller_spec.rb&quot;)
+  end
+  
+  it &quot;should generate a Test::Unit::TestCase test if using the Test::Unit::TestCase framework with optional actions&quot; do
+    temp_app_config(&quot;mack::testing_framework&quot; =&gt; &quot;test_case&quot;) do
+      file = File.join(Mack.root, &quot;test&quot;, &quot;controllers&quot;, &quot;zoos_controller_test.rb&quot;)
+      File.should_not be_exists(file)
+      ControllerGenerator.run(&quot;name&quot; =&gt; &quot;zoo&quot;, &quot;actions&quot; =&gt; &quot;index,show&quot;)
+      File.should be_exists(file)
+      File.read(file).should == fixture(&quot;zoos_controller_test_with_actions.rb&quot;)
+    end
+  end
+  
+  it &quot;should generate a RSpec test if using the RSpec framework with optional actions&quot; do
+    file = File.join(Mack.root, &quot;test&quot;, &quot;controllers&quot;, &quot;zoos_controller_spec.rb&quot;)
+    File.should_not be_exists(file)
+    ControllerGenerator.run(&quot;name&quot; =&gt; &quot;zoo&quot;, &quot;actions&quot; =&gt; &quot;index,show&quot;)
+    File.should be_exists(file)
+    File.read(file).should == fixture(&quot;zoos_controller_spec_with_actions.rb&quot;)
   end
   
 end
\ No newline at end of file</diff>
      <filename>test/unit/generators/controller_generator_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>60dadd07bd83108aef02960cc7d154a830c9d6e4</id>
    </parent>
    <parent>
      <id>b467b7e32ec4b5a92fe6d7936892051f1ea53d73</id>
    </parent>
  </parents>
  <author>
    <name>dsutedja</name>
    <email>dsutedja@helium.com</email>
  </author>
  <url>http://github.com/markbates/mack/commit/04e0b9767efc2e3e6e4693ca2865435d8c1088b1</url>
  <id>04e0b9767efc2e3e6e4693ca2865435d8c1088b1</id>
  <committed-date>2008-08-05T11:27:14-07:00</committed-date>
  <authored-date>2008-08-05T11:27:14-07:00</authored-date>
  <message>Merge branch 'master' of git@github.com:markbates/mack</message>
  <tree>88fa3fe57199f67454b07d520e5b9f0b97c862aa</tree>
  <committer>
    <name>dsutedja</name>
    <email>dsutedja@helium.com</email>
  </committer>
</commit>
