mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-31 06:31:41 +00:00
12346: refactor bulk_line_items_controller spec
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user