mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Add fields for outgoing exchange collection details
This commit is contained in:
@@ -8,3 +8,8 @@
|
||||
- else
|
||||
{{ incomingExchangesVariants().length }}
|
||||
selected
|
||||
- if type == 'distributor'
|
||||
%td.collection-details
|
||||
= text_field_tag 'order_cycle_outgoing_exchange_{{ $index }}_pickup_time', '', 'id' => 'order_cycle_outgoing_exchange_{{ $index }}_pickup_time', 'placeholder' => 'Pickup time / date', 'ng-model' => 'exchange.pickup_time'
|
||||
%br/
|
||||
= text_field_tag 'order_cycle_outgoing_exchange_{{ $index }}_pickup_instructions', '', 'id' => 'order_cycle_outgoing_exchange_{{ $index }}_pickup_instructions', 'placeholder' => 'Delivery instructions', 'ng-model' => 'exchange.pickup_instructions'
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
%th
|
||||
%th Distributor
|
||||
%th Products
|
||||
%th Collection details
|
||||
%tbody{'ng-repeat' => 'exchange in order_cycle.outgoing_exchanges'}
|
||||
%tr.distributor
|
||||
= render 'exchange_form', :f => f, :type => 'distributor'
|
||||
|
||||
@@ -60,6 +60,10 @@ feature %q{
|
||||
# And I add a distributor with the same products
|
||||
select 'My distributor', from: 'new_distributor_id'
|
||||
click_button 'Add distributor'
|
||||
|
||||
fill_in 'order_cycle_outgoing_exchange_0_pickup_time', with: 'pickup time'
|
||||
fill_in 'order_cycle_outgoing_exchange_0_pickup_instructions', with: 'pickup instructions'
|
||||
|
||||
page.find('table.exchanges tr.distributor td.products input').click
|
||||
check 'order_cycle_outgoing_exchange_0_variants_2'
|
||||
check 'order_cycle_outgoing_exchange_0_variants_3'
|
||||
@@ -82,6 +86,12 @@ feature %q{
|
||||
# And it should have some variants selected
|
||||
OrderCycle.last.exchanges.first.variants.count.should == 2
|
||||
OrderCycle.last.exchanges.last.variants.count.should == 2
|
||||
|
||||
# And my pickup time and instructions should have been saved
|
||||
oc = OrderCycle.last
|
||||
exchange = oc.exchanges.where(:sender_id => oc.coordinator_id).first
|
||||
exchange.pickup_time.should == 'pickup time'
|
||||
exchange.pickup_instructions.should == 'pickup instructions'
|
||||
end
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user