diff options
author | Azul <azul@riseup.net> | 2016-08-17 16:11:46 +0200 |
---|---|---|
committer | Azul <azul@riseup.net> | 2016-08-17 16:12:17 +0200 |
commit | 20bb76848b852bba9ab3c99b1c2a68464585bd56 (patch) | |
tree | bbcd028b74179ea7c76abb1ffb66a5f52acd881b /test/functional | |
parent | 44910c0909f28791fe6725fa76301e5111ece3b4 (diff) |
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 .
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/home_controller_test.rb | 16 |
1 files changed, 16 insertions, 0 deletions
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 |