Add fields for outgoing exchange collection details

This commit is contained in:
Rohan Mitchell
2013-01-18 14:24:17 +11:00
parent 9a03a58d9e
commit 87d5ffeee2
3 changed files with 16 additions and 0 deletions

View File

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

View File

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

View File

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