补充一个用例

This commit is contained in:
yafei Lee 2012-06-25 08:17:56 +08:00
parent 404445f3af
commit 3460058519
1 changed files with 10 additions and 0 deletions

View File

@ -11,4 +11,14 @@ describe BlogsController do
get :index get :index
assigns[:posts][1].title.should == a.title assigns[:posts][1].title.should == a.title
end 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 end