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