@@ -2058,7 +2058,6 @@ def test_expense_entries_show_bad_include_missing_relationship
20582058 assert_cacheable_get :show , params : { id : 1 , include : 'isoCurrencies,employees' }
20592059 assert_response :bad_request
20602060 assert_match /isoCurrencies is not a valid relationship of expenseEntries/ , json_response [ 'errors' ] [ 0 ] [ 'detail' ]
2061- assert_match /employees is not a valid relationship of expenseEntries/ , json_response [ 'errors' ] [ 1 ] [ 'detail' ]
20622061 end
20632062
20642063 def test_expense_entries_show_bad_include_missing_sub_relationship
@@ -2067,6 +2066,18 @@ def test_expense_entries_show_bad_include_missing_sub_relationship
20672066 assert_match /post is not a valid relationship of people/ , json_response [ 'errors' ] [ 0 ] [ 'detail' ]
20682067 end
20692068
2069+ def test_invalid_include
2070+ assert_cacheable_get :index , params : { include : 'invalid../../../../' }
2071+ assert_response :bad_request
2072+ assert_match /invalid is not a valid relationship of expenseEntries/ , json_response [ 'errors' ] [ 0 ] [ 'detail' ]
2073+ end
2074+
2075+ def test_invalid_include_long_garbage_string
2076+ assert_cacheable_get :index , params : { include : 'invalid.foo.bar.dfsdfs,dfsdfs.sdfwe.ewrerw.erwrewrew' }
2077+ assert_response :bad_request
2078+ assert_match /invalid is not a valid relationship of expenseEntries/ , json_response [ 'errors' ] [ 0 ] [ 'detail' ]
2079+ end
2080+
20702081 def test_expense_entries_show_fields
20712082 assert_cacheable_get :show , params : { id : 1 , include : 'isoCurrency,employee' , 'fields' => { 'expenseEntries' => 'transactionDate' } }
20722083 assert_response :success
0 commit comments