@@ -1951,26 +1951,26 @@ def test_show_to_one_relationship_nil
19511951 }
19521952 end
19531953
1954- def test_get_related_resources_sorted
1955- assert_cacheable_get :get_related_resources , params : { person_id : '1001' , relationship : 'posts' , source :'people' , sort : 'title' }
1954+ def test_index_related_resources_sorted
1955+ assert_cacheable_get :index_related_resources , params : { person_id : '1001' , relationship : 'posts' , source :'people' , sort : 'title' }
19561956 assert_response :success
19571957 assert_equal 'JR How To' , json_response [ 'data' ] [ 0 ] [ 'attributes' ] [ 'title' ]
19581958 assert_equal 'New post' , json_response [ 'data' ] [ 2 ] [ 'attributes' ] [ 'title' ]
1959- assert_cacheable_get :get_related_resources , params : { person_id : '1001' , relationship : 'posts' , source :'people' , sort : '-title' }
1959+ assert_cacheable_get :index_related_resources , params : { person_id : '1001' , relationship : 'posts' , source :'people' , sort : '-title' }
19601960 assert_response :success
19611961 assert_equal 'New post' , json_response [ 'data' ] [ 0 ] [ 'attributes' ] [ 'title' ]
19621962 assert_equal 'JR How To' , json_response [ 'data' ] [ 2 ] [ 'attributes' ] [ 'title' ]
19631963 end
19641964
1965- def test_get_related_resources_default_sorted
1966- assert_cacheable_get :get_related_resources , params : { person_id : '1001' , relationship : 'posts' , source :'people' }
1965+ def test_index_related_resources_default_sorted
1966+ assert_cacheable_get :index_related_resources , params : { person_id : '1001' , relationship : 'posts' , source :'people' }
19671967 assert_response :success
19681968 assert_equal 'New post' , json_response [ 'data' ] [ 0 ] [ 'attributes' ] [ 'title' ]
19691969 assert_equal 'JR How To' , json_response [ 'data' ] [ 2 ] [ 'attributes' ] [ 'title' ]
19701970 end
19711971
1972- def test_get_related_resources_has_many_filtered
1973- assert_cacheable_get :get_related_resources , params : { person_id : '1001' , relationship : 'posts' , source :'people' , filter : { title : 'JR How To' } }
1972+ def test_index_related_resources_has_many_filtered
1973+ assert_cacheable_get :index_related_resources , params : { person_id : '1001' , relationship : 'posts' , source :'people' , filter : { title : 'JR How To' } }
19741974 assert_response :success
19751975 assert_equal 'JR How To' , json_response [ 'data' ] [ 0 ] [ 'attributes' ] [ 'title' ]
19761976 assert_equal 1 , json_response [ 'data' ] . size
@@ -2494,8 +2494,8 @@ def test_invalid_filter_value
24942494 assert_response :bad_request
24952495 end
24962496
2497- def test_invalid_filter_value_for_get_related_resources
2498- assert_cacheable_get :get_related_resources , params : {
2497+ def test_invalid_filter_value_for_index_related_resources
2498+ assert_cacheable_get :index_related_resources , params : {
24992499 hair_cut_id : 1 ,
25002500 relationship : 'people' ,
25012501 source : 'hair_cuts' ,
@@ -2513,11 +2513,11 @@ def test_valid_filter_value
25132513 assert_equal 'Joe Author' , json_response [ 'data' ] [ 0 ] [ 'attributes' ] [ 'name' ]
25142514 end
25152515
2516- def test_get_related_resource_no_namespace
2516+ def test_show_related_resource_no_namespace
25172517 original_config = JSONAPI . configuration . dup
25182518 JSONAPI . configuration . json_key_format = :dasherized_key
25192519 JSONAPI . configuration . route_format = :underscored_key
2520- assert_cacheable_get :get_related_resource , params : { post_id : '2' , relationship : 'author' , source :'posts' }
2520+ assert_cacheable_get :show_related_resource , params : { post_id : '2' , relationship : 'author' , source :'posts' }
25212521 assert_response :success
25222522
25232523 assert_hash_equals (
@@ -2579,19 +2579,19 @@ def test_get_related_resource_no_namespace
25792579 JSONAPI . configuration = original_config
25802580 end
25812581
2582- def test_get_related_resource_includes
2582+ def test_show_related_resource_includes
25832583 original_config = JSONAPI . configuration . dup
25842584 JSONAPI . configuration . json_key_format = :dasherized_key
25852585 JSONAPI . configuration . route_format = :underscored_key
2586- assert_cacheable_get :get_related_resource , params : { post_id : '2' , relationship : 'author' , source :'posts' , include : 'posts' }
2586+ assert_cacheable_get :show_related_resource , params : { post_id : '2' , relationship : 'author' , source :'posts' , include : 'posts' }
25872587 assert_response :success
25882588 assert_equal 'posts' , json_response [ 'included' ] [ 0 ] [ 'type' ]
25892589 ensure
25902590 JSONAPI . configuration = original_config
25912591 end
25922592
2593- def test_get_related_resource_nil
2594- get :get_related_resource , params : { post_id : '17' , relationship : 'author' , source :'posts' }
2593+ def test_show_related_resource_nil
2594+ get :show_related_resource , params : { post_id : '17' , relationship : 'author' , source :'posts' }
25952595 assert_response :success
25962596 assert_hash_equals json_response ,
25972597 {
@@ -3390,10 +3390,10 @@ def test_books_delete_approved_comment_limited_user_using_relation_name_reflecte
33903390 book_comment . delete
33913391 end
33923392
3393- def test_get_related_resources_pagination
3393+ def test_index_related_resources_pagination
33943394 Api ::V2 ::BookResource . paginator :offset
33953395
3396- assert_cacheable_get :get_related_resources , params : { author_id : '1003' , relationship : 'books' , source :'api/v2/authors' }
3396+ assert_cacheable_get :index_related_resources , params : { author_id : '1003' , relationship : 'books' , source :'api/v2/authors' }
33973397 assert_response :success
33983398 assert_equal 10 , json_response [ 'data' ] . size
33993399 assert_equal 3 , json_response [ 'links' ] . size
@@ -3525,8 +3525,8 @@ def test_save_model_callbacks_fail
35253525end
35263526
35273527class Api ::V1 ::MoonsControllerTest < ActionController ::TestCase
3528- def test_get_related_resource
3529- assert_cacheable_get :get_related_resource , params : { crater_id : 'S56D' , relationship : 'moon' , source : "api/v1/craters" }
3528+ def test_show_related_resource
3529+ assert_cacheable_get :show_related_resource , params : { crater_id : 'S56D' , relationship : 'moon' , source : "api/v1/craters" }
35303530 assert_response :success
35313531 assert_hash_equals ( {
35323532 data : {
@@ -3541,12 +3541,12 @@ def test_get_related_resource
35413541 } , json_response )
35423542 end
35433543
3544- def test_get_related_resources_with_select_some_db_columns
3544+ def test_index_related_resources_with_select_some_db_columns
35453545 Api ::V1 ::MoonResource . paginator :paged
35463546 original_config = JSONAPI . configuration . dup
35473547 JSONAPI . configuration . top_level_meta_include_record_count = true
35483548 JSONAPI . configuration . json_key_format = :dasherized_key
3549- assert_cacheable_get :get_related_resources , params : { planet_id : '1' , relationship : 'moons' , source : 'api/v1/planets' }
3549+ assert_cacheable_get :index_related_resources , params : { planet_id : '1' , relationship : 'moons' , source : 'api/v1/planets' }
35503550 assert_response :success
35513551 assert_equal 1 , json_response [ 'meta' ] [ 'record-count' ]
35523552 ensure
@@ -3564,8 +3564,8 @@ def test_show_single
35643564 assert_nil json_response [ 'included' ]
35653565 end
35663566
3567- def test_get_related_resources
3568- assert_cacheable_get :get_related_resources , params : { moon_id : '1' , relationship : 'craters' , source : "api/v1/moons" }
3567+ def test_index_related_resources
3568+ assert_cacheable_get :index_related_resources , params : { moon_id : '1' , relationship : 'craters' , source : "api/v1/moons" }
35693569 assert_response :success
35703570 assert_hash_equals ( {
35713571 data : [
@@ -3587,9 +3587,9 @@ def test_get_related_resources
35873587 } , json_response )
35883588 end
35893589
3590- def test_get_related_resources_filtered
3590+ def test_index_related_resources_filtered
35913591 $test_user = Person . find ( 1001 )
3592- assert_cacheable_get :get_related_resources ,
3592+ assert_cacheable_get :index_related_resources ,
35933593 params : {
35943594 moon_id : '1' ,
35953595 relationship : 'craters' ,
0 commit comments