From 259b109e6e928d78bb3b107bd77cccdc1138ae89 Mon Sep 17 00:00:00 2001 From: afthab vp Date: Wed, 18 Dec 2024 12:03:00 +0530 Subject: [PATCH] Resolve conflict in cherry-pick of ac1838192e05559f4a35634bdee126649f19ab01 and change the commit message --- .../requests/api/v1/models_controller_spec.rb | 15 +++++++++++++++ .../requests/api/v1/sync_runs_controller_spec.rb | 3 +++ 2 files changed, 18 insertions(+) diff --git a/server/spec/requests/api/v1/models_controller_spec.rb b/server/spec/requests/api/v1/models_controller_spec.rb index 80a378e4..b89b97c5 100644 --- a/server/spec/requests/api/v1/models_controller_spec.rb +++ b/server/spec/requests/api/v1/models_controller_spec.rb @@ -61,6 +61,21 @@ expect(response_hash[:data].count).to eql(8) expect(response_hash.dig(:data, 0, :type)).to eq("models") expect(response_hash.dig(:links, :first)).to include("http://www.example.com/api/v1/models?page=1&per_page=20") +<<<<<<< HEAD +======= + end + + it "returns success and no models when the data is empty" do + workspace.models.destroy_all + get "/api/v1/models", headers: auth_headers(user, workspace_id) + expect(response).to have_http_status(:ok) + response_hash = JSON.parse(response.body).with_indifferent_access + expect(response_hash[:data].count).to eql(0) + expect(response_hash.dig(:links, :first)).to include("http://www.example.com/api/v1/models?page=1") + expect(response_hash.dig(:links, :last)).to include("http://www.example.com/api/v1/models?page=1") + expect(response_hash.dig(:links, :next)).to be_nil + expect(response_hash.dig(:links, :prev)).to be_nil +>>>>>>> ac183819 (chore(CE): list api accept per page (#732)) end it "returns success and all mode for viewer role" do diff --git a/server/spec/requests/api/v1/sync_runs_controller_spec.rb b/server/spec/requests/api/v1/sync_runs_controller_spec.rb index a3e2f08a..57d32437 100644 --- a/server/spec/requests/api/v1/sync_runs_controller_spec.rb +++ b/server/spec/requests/api/v1/sync_runs_controller_spec.rb @@ -38,9 +38,12 @@ context "when it is an authenticated user" do it "returns success and fetch sync " do +<<<<<<< HEAD <<<<<<< HEAD get "/api/v1/syncs/#{sync.id}/sync_runs", headers: auth_headers(user, workspace_id) ======= +======= +>>>>>>> ac183819 (chore(CE): list api accept per page (#732)) get "/api/v1/syncs/#{sync.id}/sync_runs?page=1&per_page=20", headers: auth_headers(user, workspace_id) response_hash = JSON.parse(response.body).with_indifferent_access >>>>>>> ac183819 (chore(CE): list api accept per page (#732))