summaryrefslogtreecommitdiff
path: root/engines/support/test/functional/tickets_controller_test.rb
diff options
context:
space:
mode:
authorazul <azul@riseup.net>2016-11-21 10:58:00 +0000
committerazul <azul@riseup.net>2016-11-21 10:58:00 +0000
commitcf5e96128f27597e878d088443078c0e188895b5 (patch)
treec72abe71c0c44c36fda0d171769f7e8ff26d7e38 /engines/support/test/functional/tickets_controller_test.rb
parent6f1a49ec7e094191ff52f56d3a436aea81323ba1 (diff)
parent9e9c69c1357882d4221d1c511c3c7f6b36c094cc (diff)
Merge branch 'bugfix/handle-missing-ticket-params' into 'master'
bugfix: handle missing params for ticket gracefully This used to trigger a 500. Fixes [#8395](https://leap.se/code/issues/8395) See merge request !11
Diffstat (limited to 'engines/support/test/functional/tickets_controller_test.rb')
-rw-r--r--engines/support/test/functional/tickets_controller_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/engines/support/test/functional/tickets_controller_test.rb b/engines/support/test/functional/tickets_controller_test.rb
index 5c2b346..2f1e661 100644
--- a/engines/support/test/functional/tickets_controller_test.rb
+++ b/engines/support/test/functional/tickets_controller_test.rb
@@ -78,6 +78,16 @@ class TicketsControllerTest < ActionController::TestCase
assert_nil assigns(:tickets).detect{|t| t.created_by != @user}
end
+
+ test "should rerender form on missing info" do
+ params = { :subject => "unauth ticket test subject",
+ :comments_attributes => {"0" => {}}
+ }
+ assert_raises ActionController::ParameterMissing do
+ post :create, :ticket => params
+ end
+ end
+
test "should create unauthenticated ticket" do
params = {:subject => "unauth ticket test subject", :comments_attributes => {"0" => {"body" =>"body of test ticket"}}}