Changeset 1645

Show
Ignore:
Timestamp:
02/23/08 08:49:12 (3 months ago)
Author:
pdcawley
Message:

Fixed a bug that was masked by a bad mock.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/app/controllers/comments_controller.rb

    r1552 r1645  
    3737        this_blog.requested_article(params).published_comments 
    3838      else 
    39         this_blog.published_comments.with_options(this_blog.rss_limit_params) do |c| 
    40           c.find(:all, :order => 'created_at DESC') 
    41         end 
     39        this_blog.published_comments.find(:all, this_blog.rss_limit_params.merge(:order => 'created_at DESC')) 
    4240      end 
    4341  end 
  • trunk/app/controllers/trackbacks_controller.rb

    r1601 r1645  
    77        # Part of the trackback spec... not sure what we should be doing here though. 
    88      else 
    9           begin   
     9          begin 
    1010              @trackback =  this_blog.ping_article!( 
    1111                params.merge(:ip => request.remote_ip, :published => true)) 
    12               ""     
     12              "" 
    1313          rescue ActiveRecord::RecordNotFound, ActiveRecord::StatementInvalid 
    1414            throw :error, "Article id #{params[:id]} not found." 
     
    3232        this_blog.requested_article(params).published_trackbacks 
    3333      else 
    34         this_blog.published_trackbacks.with_options(this_blog.rss_limit_params) do |t| 
    35           t.find(:all, :order => 'created_at DESC') 
    36         end 
     34        this_blog.published_trackbacks.find(:all, this_blog.rss_limit_params(:order => 'created_at DESC')) 
    3735      end 
    3836  end 
  • trunk/spec/controllers/comments_controller_spec.rb

    r1622 r1645  
    4343                  :requested_article          => @article) 
    4444 
     45 
    4546    @article.stub!(:to_param).and_return(['2007', '10', '11', 'slug']) 
    4647    Article.stub!(:find).and_return(@article) 
     
    4849    Comment.stub!(:find).and_return(@comment) 
    4950    Blog.stub!(:find).and_return(@blog) 
    50 #    controller.stub!(:article_path).and_return('/articles/2007/10/11/slug') 
    5151  end 
    5252end 
     
    176176 
    177177describe CommentsController, 'GET /comments' do 
    178   before do 
    179     @the_mock = mock('blog', :null_object => true) 
    180     @the_mock.stub!(:lang).and_return('en_US') 
    181     Blog.stub!(:find).and_return(@the_mock) 
    182   end 
    183  
    184178  it "should be successful" do 
    185179    get 'index' 
     
    197191 
    198192describe CommentsController, "GET /comments.:format" do 
    199   before do 
    200     @the_mock = mock('blog', :null_object => true) 
    201     @the_mock.stub!(:lang).and_return('en_US') 
    202     controller.stub!(:this_blog).and_return(@the_mock) 
    203   end 
    204  
    205193  it ":format => 'atom' should return an atom feed" do 
    206194    get 'index', :format => 'atom'