summaryrefslogtreecommitdiff
path: root/engines/support/test/functional
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2014-04-22 14:44:11 +0200
committerAzul <azul@leap.se>2014-04-24 20:36:11 +0200
commit5d6a82a67bffc0930ea480164be2aca60ea0d6a1 (patch)
tree638414630aa360ba03c14affe40dc1bc4f15a17b /engines/support/test/functional
parent7df11eed6aa48d1f61ee7f3700295c78b62358f0 (diff)
add tests for invalid ticket creation
Diffstat (limited to 'engines/support/test/functional')
-rw-r--r--engines/support/test/functional/tickets_controller_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/engines/support/test/functional/tickets_controller_test.rb b/engines/support/test/functional/tickets_controller_test.rb
index 416fb73..d746b59 100644
--- a/engines/support/test/functional/tickets_controller_test.rb
+++ b/engines/support/test/functional/tickets_controller_test.rb
@@ -72,6 +72,17 @@ class TicketsControllerTest < ActionController::TestCase
end
+ test "handle invalid ticket" do
+ params = {:subject => "unauth ticket test subject", :comments_attributes => {"0" => {"body" =>"body of test ticket"}}, :email => 'a'}
+
+ assert_no_difference('Ticket.count') do
+ post :create, :ticket => params
+ end
+
+ assert_template :new
+ assert_equal params[:subject], assigns(:ticket).subject
+ end
+
test "should create authenticated ticket" do
params = {:subject => "auth ticket test subject", :comments_attributes => {"0" => {"body" =>"body of test ticket"}}}