@@ -45,6 +45,15 @@ def test_get_underscored_key
4545 JSONAPI . configuration = original_config
4646 end
4747
48+ def test_filter_with_value_containing_double_quote
49+ original_config = JSONAPI . configuration . dup
50+ JSONAPI . configuration . json_key_format = :underscored_key
51+ get '/iso_currencies?filter[country_name]=%22'
52+ assert_jsonapi_response 200
53+ ensure
54+ JSONAPI . configuration = original_config
55+ end
56+
4857 def test_get_underscored_key_filtered
4958 original_config = JSONAPI . configuration . dup
5059 JSONAPI . configuration . json_key_format = :underscored_key
@@ -1063,6 +1072,26 @@ def test_sort_parameter_not_allowed
10631072 JSONAPI . configuration . allow_sort = true
10641073 end
10651074
1075+ def test_sort_parameter_quoted
1076+ get '/api/v2/books?sort=%22title%22' , headers : { 'Accept' => JSONAPI ::MEDIA_TYPE }
1077+ assert_jsonapi_response 200
1078+ end
1079+
1080+ def test_sort_parameter_openquoted
1081+ get '/api/v2/books?sort=%22title' , headers : { 'Accept' => JSONAPI ::MEDIA_TYPE }
1082+ assert_jsonapi_response 400
1083+ end
1084+
1085+ def test_include_parameter_quoted
1086+ get '/api/v2/posts?include=%22author%22' , headers : { 'Accept' => JSONAPI ::MEDIA_TYPE }
1087+ assert_jsonapi_response 200
1088+ end
1089+
1090+ def test_include_parameter_openquoted
1091+ get '/api/v2/posts?include=%22author' , headers : { 'Accept' => JSONAPI ::MEDIA_TYPE }
1092+ assert_jsonapi_response 400
1093+ end
1094+
10661095 def test_getting_different_resources_when_sti
10671096 assert_cacheable_jsonapi_get '/vehicles'
10681097 types = json_response [ 'data' ] . map { |r | r [ 'type' ] } . sort
0 commit comments