diff options
-rw-r--r-- | help/test/functional/tickets_controller_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/help/test/functional/tickets_controller_test.rb b/help/test/functional/tickets_controller_test.rb index c88e7ae..611cf86 100644 --- a/help/test/functional/tickets_controller_test.rb +++ b/help/test/functional/tickets_controller_test.rb @@ -194,6 +194,18 @@ class TicketsControllerTest < ActionController::TestCase assigns(:ticket).destroy + # test ordering + + get :index, {:admin_status => "mine", :open_status => "open", :sort_order => 'created_at_desc'} + first_tick = assigns(:all_tickets).all.first + last_tick = assigns(:all_tickets).all.last + # and now reverse order: + get :index, {:admin_status => "mine", :open_status => "open", :sort_order => 'created_at_asc'} + assert_equal first_tick, assigns(:all_tickets).all.last + assert_equal last_tick, assigns(:all_tickets).all.first + assert_not_equal first_tick, assigns(:all_tickets).all.first + assert_not_equal last_tick, assigns(:all_tickets).all.last + end end |