File tree 1 file changed +9
-0
lines changed
test/action_controller/json_api 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,15 @@ def test_render_only_last_and_next_pagination_links_with_additional_params
96
96
assert_equal expected_links , response [ 'links' ]
97
97
end
98
98
99
+ def test_render_only_prev_and_first_pagination_links_with_additional_params
100
+ expected_links = { "self" => "#{ KAMINARI_URI } ?page%5Bnumber%5D=3&page%5Bsize%5D=1&teste=additional" ,
101
+ "first" => "#{ KAMINARI_URI } ?page%5Bnumber%5D=1&page%5Bsize%5D=1&teste=additional" ,
102
+ "prev" => "#{ KAMINARI_URI } ?page%5Bnumber%5D=2&page%5Bsize%5D=1&teste=additional" }
103
+ get :render_pagination_using_kaminari , page : { number : 3 , size : 1 } , teste : "additional"
104
+ response = JSON . parse ( @response . body )
105
+ assert_equal expected_links , response [ 'links' ]
106
+ end
107
+
99
108
def test_array_without_pagination_links
100
109
get :render_array_without_pagination_links , page : { number : 2 , size : 1 }
101
110
response = JSON . parse ( @response . body )
You can’t perform that action at this time.
0 commit comments