diff options
Diffstat (limited to 'engines/support/test')
-rw-r--r-- | engines/support/test/functional/tickets_controller_test.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/engines/support/test/functional/tickets_controller_test.rb b/engines/support/test/functional/tickets_controller_test.rb index e103d01..1d074cc 100644 --- a/engines/support/test/functional/tickets_controller_test.rb +++ b/engines/support/test/functional/tickets_controller_test.rb @@ -112,5 +112,22 @@ class TicketsControllerTest < ActionController::TestCase assert_not_nil assigns(:ticket).comments.first.posted_by assert_equal assigns(:ticket).comments.first.posted_by, @current_user.id end + + test "close ticket" do + login + open_ticket = FactoryGirl.create :ticket_with_comment, + created_by: @current_user.id + post :close, id: open_ticket.id + assert !open_ticket.reload.is_open + end + + test "reopen ticket" do + login + open_ticket = FactoryGirl.create :ticket_with_comment, + created_by: @current_user.id, is_open: false + post :open, id: open_ticket.id + assert open_ticket.reload.is_open + end + end |