Add spec for remembering sort order
This commit is contained in:
parent
56b0d7821d
commit
c4bc24d485
1 changed files with 9 additions and 0 deletions
|
|
@ -117,6 +117,15 @@ describe AspectsController do
|
||||||
get :index, :sort_order => 'created_at'
|
get :index, :sort_order => 'created_at'
|
||||||
assigns(:posts).should == @posts.reverse
|
assigns(:posts).should == @posts.reverse
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "remembers your sort order and lets you override the memory" do
|
||||||
|
get :index, :sort_order => "created_at"
|
||||||
|
assigns(:posts).should == @posts.reverse
|
||||||
|
get :index
|
||||||
|
assigns(:posts).should == @posts.reverse
|
||||||
|
get :index, :sort_order => "updated_at"
|
||||||
|
assigns(:posts).should == @posts
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it "returns all posts by default" do
|
it "returns all posts by default" do
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue