@@ -1972,6 +1972,36 @@ def test_documents_index_with_polymorphic_include_one_level
19721972 end
19731973end
19741974
1975+ class PicturesControllerTest < ActionController ::TestCase
1976+ def test_pictures_index
1977+ assert_cacheable_get :index
1978+ assert_response :success
1979+ assert_equal 3 , json_response [ 'data' ] . size
1980+ end
1981+
1982+ def test_pictures_index_with_polymorphic_include_one_level
1983+ assert_cacheable_get :index , params : { include : 'imageable' }
1984+ assert_response :success
1985+ assert_equal 3 , json_response [ 'data' ] . size
1986+ assert_equal 2 , json_response [ 'included' ] . size
1987+ end
1988+ end
1989+
1990+ class DocumentsControllerTest < ActionController ::TestCase
1991+ def test_documents_index
1992+ assert_cacheable_get :index
1993+ assert_response :success
1994+ assert_equal 1 , json_response [ 'data' ] . size
1995+ end
1996+
1997+ def test_documents_index_with_polymorphic_include_one_level
1998+ assert_cacheable_get :index , params : { include : 'pictures' }
1999+ assert_response :success
2000+ assert_equal 1 , json_response [ 'data' ] . size
2001+ assert_equal 1 , json_response [ 'included' ] . size
2002+ end
2003+ end
2004+
19752005class ExpenseEntriesControllerTest < ActionController ::TestCase
19762006 def setup
19772007 JSONAPI . configuration . json_key_format = :camelized_key
0 commit comments