blob: 04ea722e7f875e0f80246003be901de666fe098e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
require 'test_helper'
class ErrorHandlingTest < ActionController::TestCase
tests HomeController
def setup
HomeController.any_instance.stubs(:index).raises
end
def test_json_error
get :index, format: :json
assert_equal 'application/json', @response.content_type
end
def test_html_error_reraises
assert_raises RuntimeError do
get :index
end
end
end
|