From 840933a29f6b0656838308b47c372314ceaf27f3 Mon Sep 17 00:00:00 2001 From: afthab vp Date: Thu, 26 Dec 2024 13:43:46 +0530 Subject: [PATCH] fix(CE): resolve conflicts --- server/spec/requests/api/v1/models_controller_spec.rb | 3 --- .../spec/requests/api/v1/sync_runs_controller_spec.rb | 11 +++-------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/server/spec/requests/api/v1/models_controller_spec.rb b/server/spec/requests/api/v1/models_controller_spec.rb index b89b97c5..447c9ecf 100644 --- a/server/spec/requests/api/v1/models_controller_spec.rb +++ b/server/spec/requests/api/v1/models_controller_spec.rb @@ -61,8 +61,6 @@ 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 @@ -75,7 +73,6 @@ 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 57d32437..278b277e 100644 --- a/server/spec/requests/api/v1/sync_runs_controller_spec.rb +++ b/server/spec/requests/api/v1/sync_runs_controller_spec.rb @@ -38,18 +38,13 @@ 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)) expect(response).to have_http_status(:ok) - response_hash = JSON.parse(response.body).with_indifferent_access expect(response_hash[:data].size).to eq(2) + first_row_date = DateTime.parse(response_hash[:data].first.dig(:attributes, :updated_at)) + second_row_date = DateTime.parse(response_hash[:data].last.dig(:attributes, :updated_at)) + expect(first_row_date).to be > second_row_date response_hash[:data].each_with_index do |row, _index| sync_run = sync_runs.find { |sr| sr.id == row[:id].to_i }