补充一个用例
This commit is contained in:
parent
404445f3af
commit
3460058519
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue