From d2612ecc146ce23d6de55b62383e6ea5e8761a70 Mon Sep 17 00:00:00 2001 From: markokajzer Date: Sun, 1 Dec 2024 20:21:38 +0100 Subject: [PATCH] play with ci --- .../api/endpoints/it_behaves_like_a_cursor_api.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/spec/support/api/endpoints/it_behaves_like_a_cursor_api.rb b/spec/support/api/endpoints/it_behaves_like_a_cursor_api.rb index d998338..afe6f17 100644 --- a/spec/support/api/endpoints/it_behaves_like_a_cursor_api.rb +++ b/spec/support/api/endpoints/it_behaves_like_a_cursor_api.rb @@ -27,15 +27,23 @@ end end - it 'paginates over the entire collection' do + fit 'paginates over the entire collection', :focus do models_ids = [] next_cursor = { size: 3 } loop do + puts 'YALLAH' + puts "model_ps: #{model_ps}" + puts "next params: #{next_cursor.merge(cursor_params)}" + response = client.send(model_ps, next_cursor.merge(cursor_params)) + puts response.inspect + models_ids.concat(response.map { |instance| instance._links.self._url.gsub("http://example.org/api/#{model_ps}/", '') }) + puts "next: #{response._links[:next]}" break unless response._links[:next] next_cursor = CGI.parse(URI.parse(response._links.next._url).query).map { |a| [a[0], a[1][0]] }.to_h + puts "next_cursor: #{next_cursor.inspect}" end expect(models_ids.uniq.count).to eq model.all.count end