Changeset 1645
- Timestamp:
- 02/23/08 08:49:12 (3 months ago)
- Files:
-
- trunk/app/controllers/comments_controller.rb (modified) (1 diff)
- trunk/app/controllers/trackbacks_controller.rb (modified) (2 diffs)
- trunk/spec/controllers/comments_controller_spec.rb (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/app/controllers/comments_controller.rb
r1552 r1645 37 37 this_blog.requested_article(params).published_comments 38 38 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')) 42 40 end 43 41 end trunk/app/controllers/trackbacks_controller.rb
r1601 r1645 7 7 # Part of the trackback spec... not sure what we should be doing here though. 8 8 else 9 begin 9 begin 10 10 @trackback = this_blog.ping_article!( 11 11 params.merge(:ip => request.remote_ip, :published => true)) 12 "" 12 "" 13 13 rescue ActiveRecord::RecordNotFound, ActiveRecord::StatementInvalid 14 14 throw :error, "Article id #{params[:id]} not found." … … 32 32 this_blog.requested_article(params).published_trackbacks 33 33 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')) 37 35 end 38 36 end trunk/spec/controllers/comments_controller_spec.rb
r1622 r1645 43 43 :requested_article => @article) 44 44 45 45 46 @article.stub!(:to_param).and_return(['2007', '10', '11', 'slug']) 46 47 Article.stub!(:find).and_return(@article) … … 48 49 Comment.stub!(:find).and_return(@comment) 49 50 Blog.stub!(:find).and_return(@blog) 50 # controller.stub!(:article_path).and_return('/articles/2007/10/11/slug')51 51 end 52 52 end … … 176 176 177 177 describe CommentsController, 'GET /comments' do 178 before do179 @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 end183 184 178 it "should be successful" do 185 179 get 'index' … … 197 191 198 192 describe CommentsController, "GET /comments.:format" do 199 before do200 @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 end204 205 193 it ":format => 'atom' should return an atom feed" do 206 194 get 'index', :format => 'atom'
