From 20bb76848b852bba9ab3c99b1c2a68464585bd56 Mon Sep 17 00:00:00 2001 From: Azul Date: Wed, 17 Aug 2016 16:11:46 +0200 Subject: bugfix: send 406 if an unexpected format is asked for It used to run the action and then trigger a 500 because the template was not found. fixes !3 . --- test/functional/home_controller_test.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/functional/home_controller_test.rb (limited to 'test') diff --git a/test/functional/home_controller_test.rb b/test/functional/home_controller_test.rb new file mode 100644 index 0000000..cafaac5 --- /dev/null +++ b/test/functional/home_controller_test.rb @@ -0,0 +1,16 @@ +require 'test_helper' + +class HomeControllerTest < ActionController::TestCase + + def test_renders_okay + get :index + assert_response :success + end + + def test_other_formats_trigger_406 + assert_raises ActionController::UnknownFormat do + get :index, format: :xml + end + end + +end -- cgit v1.2.3