Skip to content

Commit daebb54

Browse files
committed
Add test for testing accept all header and non-jsonapi header. May need to change depending on discussion about this
1 parent be9adbb commit daebb54

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

test/controllers/controller_test.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,20 @@ def test_accept_header_jsonapi_multiple_modified
4949
assert_equal "All requests must use the '#{JSONAPI::MEDIA_TYPE}' Accept without media type parameters. This request specified '#{@request.headers['Accept']}'.", json_response['errors'][0]['detail']
5050
end
5151

52+
def test_accept_header_all
53+
@request.headers['Accept'] = "*/*"
54+
55+
get :index
56+
assert_response :success
57+
end
58+
59+
def test_accept_header_not_jsonapi
60+
@request.headers['Accept'] = 'text/plain'
61+
62+
get :index
63+
assert_response :success
64+
end
65+
5266
def test_exception_class_whitelist
5367
original_config = JSONAPI.configuration.dup
5468
JSONAPI.configuration.operations_processor = :error_raising

0 commit comments

Comments
 (0)