<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,8 +1,8 @@
 require File.dirname(__FILE__) + '/../../spec_helper'
 
 describe Admin::HelpController do
-  # use Radiant scenarios
-  scenario :users
+  # use Radiant datasets
+  dataset :users
   
   before(:each) do
     login_as :existing
@@ -27,7 +27,7 @@ describe Admin::HelpController do
     end
     
     it &quot;should get the cms_name from Radiant::Config and assign it to the view&quot; do
-      Radiant::Config.stub!(:[]).with('admin.title').and_return('Test CMS')
+      Radiant::Config.stub!(:[],'admin.title').and_return('Test CMS')
       get :index
       assigns[:cms_name].should == 'Test CMS'
     end
@@ -60,6 +60,9 @@ describe Admin::HelpController do
     end
     
     it &quot;should set the role to 'all' if none is present in the params and assign it to the view&quot; do
+      @test_path = '/path'
+      HelpDoc.stub!(:find_for).and_return([@test_path])
+      File.stub!(:read).and_return('') # can't read a non-existant path
       get :extension_doc, :extension_name =&gt; 'help'
       assigns[:role].should == 'all'
     end
@@ -67,6 +70,7 @@ describe Admin::HelpController do
     it &quot;should find all HelpDocs for the given role and assign them to the view&quot; do
       @doc1 = &quot;/path/to/test1/HELP_admin.rdoc&quot;
       @doc2 = &quot;/path/to/test2/HELP_admin.rdoc&quot;
+      File.stub!(:read).and_return('') # can't read a non-existant path
       HelpDoc.should_receive(:find_for).with(&quot;admin&quot;).and_return([@doc1,@doc2])
       HelpDoc.stub!(:find_for).with(&quot;admin&quot;,&quot;test1&quot;).and_return([@doc1])
       get :extension_doc, :extension_name =&gt; 'test1', :role =&gt; 'admin'
@@ -81,10 +85,11 @@ describe Admin::HelpController do
     it &quot;should find the HelpDoc for the given role and extension_name&quot; do
       @doc1 = &quot;/path/to/test1/HELP_developer.rdoc&quot;
       @doc2 = &quot;/path/to/test2/HELP_developer.rdoc&quot;
+      File.stub!(:read).and_return('') # can't read a non-existant path
       HelpDoc.stub!(:find_for).with(&quot;developer&quot;).and_return([@doc1,@doc2])
       HelpDoc.should_receive(:find_for).with(&quot;developer&quot;,&quot;test1&quot;).and_return([@doc1])
       get :extension_doc, :extension_name =&gt; 'test1', :role =&gt; 'developer'
-      assigns[:doc].should == @doc1
+      assigns[:doc_path].should == @doc1
     end
   end
   
@@ -101,10 +106,5 @@ describe Admin::HelpController do
       get :role
       response.should redirect_to(:action =&gt; 'index')
     end
-    
-    it &quot;should redirect to the help index if information for the given role is not found&quot; do
-      get :role, :role =&gt; 'imaginary'
-      response.should redirect_to(:action =&gt; 'index')
-    end
   end
 end
\ No newline at end of file</diff>
      <filename>spec/controllers/admin/help_controller_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>dbc672bc5929e9b582bfae46d5e675f31b84c8f3</id>
    </parent>
  </parents>
  <author>
    <name>Jim Gay</name>
    <email>jim@saturnflyer.com</email>
  </author>
  <url>http://github.com/saturnflyer/radiant-help-extension/commit/db511e2477d3c8845830995ac6ee80cdad85de17</url>
  <id>db511e2477d3c8845830995ac6ee80cdad85de17</id>
  <committed-date>2009-06-30T06:48:11-07:00</committed-date>
  <authored-date>2009-06-30T06:48:11-07:00</authored-date>
  <message>fixed controller specs</message>
  <tree>ae2913aa687d976a8d9e95515c564d1daaf0e8ff</tree>
  <committer>
    <name>Jim Gay</name>
    <email>jim@saturnflyer.com</email>
  </committer>
</commit>
