mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-20 04:59:16 +00:00
Fix admin api exchange products controller
This commit is contained in:
@@ -7,7 +7,7 @@ module Api
|
||||
attributes :name, :supplier_name, :image_url, :variants
|
||||
|
||||
def supplier_name
|
||||
object.supplier&.name
|
||||
object.variants.first.supplier&.name
|
||||
end
|
||||
|
||||
def image_url
|
||||
|
||||
@@ -39,7 +39,7 @@ module Api
|
||||
api_get :index, exchange_id: exchange.id, order_cycle_id: 666, enterprise_id: 666,
|
||||
incoming: false
|
||||
expect(json_response["products"].first["supplier_name"])
|
||||
.to eq exchange.variants.first.product.supplier.name
|
||||
.to eq exchange.variants.first.supplier.name
|
||||
end
|
||||
end
|
||||
|
||||
@@ -48,7 +48,7 @@ module Api
|
||||
api_get :index, order_cycle_id: order_cycle.id, enterprise_id: exchange.sender_id,
|
||||
incoming: true
|
||||
expect(json_response["products"].first["supplier_name"])
|
||||
.to eq exchange.variants.first.product.supplier.name
|
||||
.to eq exchange.variants.first.supplier.name
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user