diff options
author | jessib <jessib@riseup.net> | 2014-02-07 07:51:12 -0800 |
---|---|---|
committer | jessib <jessib@riseup.net> | 2014-02-07 07:51:12 -0800 |
commit | 393abdefeeed2e9653e22c85b5d1c617003e95a9 (patch) | |
tree | 8351cc3a82c7c030f07bd494c2c1998dc19d9462 /help | |
parent | cbcd4d388dec048be3d3f66c1b909515d3176ead (diff) | |
parent | 58a36ae079f9103f2aa18da48d5ea2a18aae938c (diff) |
Merge pull request #137 from azul/test/fix-red-ci
Test/fix red ci
Diffstat (limited to 'help')
-rw-r--r-- | help/test/functional/tickets_controller_test.rb | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/help/test/functional/tickets_controller_test.rb b/help/test/functional/tickets_controller_test.rb index 2b30f66..2530ba1 100644 --- a/help/test/functional/tickets_controller_test.rb +++ b/help/test/functional/tickets_controller_test.rb @@ -158,19 +158,23 @@ class TicketsControllerTest < ActionController::TestCase end test "tickets by admin" do - other_user = find_record :user - ticket = FactoryGirl.create :ticket, :created_by => other_user.id + begin + other_user = find_record :user + ticket = FactoryGirl.create :ticket, :created_by => other_user.id - login :is_admin? => true + login :is_admin? => true - get :index, {:admin_status => "all", :open_status => "open"} - assert assigns(:all_tickets).count > 1 - - # if we close one ticket, the admin should have 1 less open ticket - assert_difference('assigns[:all_tickets].count', -1) do - assigns(:tickets).first.close - assigns(:tickets).first.save get :index, {:admin_status => "all", :open_status => "open"} + assert assigns(:all_tickets).count > 0 + + # if we close one ticket, the admin should have 1 less open ticket + assert_difference('assigns[:all_tickets].count', -1) do + assigns(:tickets).first.close + assigns(:tickets).first.save + get :index, {:admin_status => "all", :open_status => "open"} + end + ensure + ticket.reload.destroy if ticket end end |