From a1b494e334406660a1f49fb7de9b043493809640 Mon Sep 17 00:00:00 2001 From: Azul Date: Fri, 13 May 2016 16:23:10 +0200 Subject: ensure invalid user ids still render the ticket form We still have strange urls requested like /pt/users/AnonymousUser.../tickets/new Not sure where they are coming from - but this should make sure we respond with sth. meaningful instead of erroring out. Conflicts: app/views/layouts/_content.html.haml --- engines/support/test/functional/tickets_controller_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'engines/support/test/functional/tickets_controller_test.rb') diff --git a/engines/support/test/functional/tickets_controller_test.rb b/engines/support/test/functional/tickets_controller_test.rb index a7a2011..5c2b346 100644 --- a/engines/support/test/functional/tickets_controller_test.rb +++ b/engines/support/test/functional/tickets_controller_test.rb @@ -35,6 +35,12 @@ class TicketsControllerTest < ActionController::TestCase assert_response :success end + test "should get new despite invalid user_id" do + get :new, user_id: :bla + assert_equal Ticket, assigns(:ticket).class + assert_response :success + end + test "unauthenticated tickets are visible" do ticket = find_record :ticket, :created_by => nil get :show, :id => ticket.id -- cgit v1.2.3