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