From 3460058519355fac855f776eb6d742d9078569b9 Mon Sep 17 00:00:00 2001 From: yafei Lee Date: Mon, 25 Jun 2012 08:17:56 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=E4=B8=80=E4=B8=AA=E7=94=A8?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spec/controllers/blogs_controller_spec.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spec/controllers/blogs_controller_spec.rb b/spec/controllers/blogs_controller_spec.rb index cfb17ff..fe7bd08 100644 --- a/spec/controllers/blogs_controller_spec.rb +++ b/spec/controllers/blogs_controller_spec.rb @@ -11,4 +11,14 @@ describe BlogsController do get :index assigns[:posts][1].title.should == a.title end + + it "index with label should get by order desc" do + a = Post.new(title: '123', content: '123'*20, type: Post::TECH) + a.save! + sleep 1 + b = Post.new(title: '1234', content: '123'*20,type: Post::TECH) + b.save! + get :index, :type=> "tech" + assigns[:posts][1].title.should == a.title + end end