From ff10a36e4a4b2077c9549511c25e9fe1903f8d09 Mon Sep 17 00:00:00 2001 From: Ahmed Ejaz Date: Mon, 24 Jun 2024 14:25:34 +0500 Subject: [PATCH] 12346: refactor bulk_line_items_controller spec --- spec/controllers/admin/bulk_line_items_controller_spec.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/spec/controllers/admin/bulk_line_items_controller_spec.rb b/spec/controllers/admin/bulk_line_items_controller_spec.rb index 72ecbc2843..999c39c945 100644 --- a/spec/controllers/admin/bulk_line_items_controller_spec.rb +++ b/spec/controllers/admin/bulk_line_items_controller_spec.rb @@ -59,13 +59,11 @@ RSpec.describe Admin::BulkLineItemsController, type: :controller do end it "formats final_weight_volume as a float" do - expect(json_response['line_items'].pluck(:final_weight_volume).all?{ |fwv| - fwv.is_a?(Float) - }).to eq(true) + expect(json_response[:line_items]).to all(include(final_weight_volume: a_kind_of(Float))) end it "returns distributor object with id key" do - expect(json_response['line_items'].pluck(:supplier).all?{ |d| d.key?('id') }).to eq(true) + expect(json_response[:line_items].pluck(:supplier)).to all(include(:id)) end end