12346: refactor bulk_line_items_controller spec

This commit is contained in:
Ahmed Ejaz
2024-06-24 14:25:34 +05:00
parent afd09091a2
commit ff10a36e4a

View File

@@ -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