@@ -2043,7 +2043,6 @@ def test_expense_entries_show_bad_include_missing_relationship
20432043 assert_cacheable_get :show , params : { id : 1 , include : 'isoCurrencies,employees' }
20442044 assert_response :bad_request
20452045 assert_match /isoCurrencies is not a valid relationship of expenseEntries/ , json_response [ 'errors' ] [ 0 ] [ 'detail' ]
2046- assert_match /employees is not a valid relationship of expenseEntries/ , json_response [ 'errors' ] [ 1 ] [ 'detail' ]
20472046 end
20482047
20492048 def test_expense_entries_show_bad_include_missing_sub_relationship
@@ -2052,6 +2051,18 @@ def test_expense_entries_show_bad_include_missing_sub_relationship
20522051 assert_match /post is not a valid relationship of people/ , json_response [ 'errors' ] [ 0 ] [ 'detail' ]
20532052 end
20542053
2054+ def test_invalid_include
2055+ assert_cacheable_get :index , params : { include : 'invalid../../../../' }
2056+ assert_response :bad_request
2057+ assert_match /invalid is not a valid relationship of expenseEntries/ , json_response [ 'errors' ] [ 0 ] [ 'detail' ]
2058+ end
2059+
2060+ def test_invalid_include_long_garbage_string
2061+ assert_cacheable_get :index , params : { include : 'invalid.foo.bar.dfsdfs,dfsdfs.sdfwe.ewrerw.erwrewrew' }
2062+ assert_response :bad_request
2063+ assert_match /invalid is not a valid relationship of expenseEntries/ , json_response [ 'errors' ] [ 0 ] [ 'detail' ]
2064+ end
2065+
20552066 def test_expense_entries_show_fields
20562067 assert_cacheable_get :show , params : { id : 1 , include : 'isoCurrency,employee' , 'fields' => { 'expenseEntries' => 'transactionDate' } }
20572068 assert_response :success
0 commit comments