mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-06 02:51:34 +00:00
Add outgoing exchange scenario spec #11326
This commit is contained in:
@@ -154,6 +154,22 @@ describe '
|
||||
create(:enterprise_fee, :flat_rate, enterprise: supplier_permitted,
|
||||
name: 'Supplier distributor fee4')
|
||||
}
|
||||
let!(:distributor_permitted_fee1) {
|
||||
create(:enterprise_fee, :per_item, enterprise: distributor_permitted,
|
||||
name: 'Distributor distributor fee1')
|
||||
}
|
||||
let!(:distributor_permitted_fee2) {
|
||||
create(:enterprise_fee, :flat_rate, enterprise: distributor_permitted,
|
||||
name: 'Distributor distributor fee2')
|
||||
}
|
||||
let!(:distributor_permitted_fee3) {
|
||||
create(:enterprise_fee, :per_item, enterprise: distributor_permitted,
|
||||
name: 'Distributor distributor fee3')
|
||||
}
|
||||
let!(:distributor_permitted_fee4) {
|
||||
create(:enterprise_fee, :flat_rate, enterprise: distributor_permitted,
|
||||
name: 'Distributor distributor fee4')
|
||||
}
|
||||
let!(:shipping_method) {
|
||||
create(:shipping_method,
|
||||
distributors: [distributor_managed, distributor_unmanaged, distributor_permitted])
|
||||
@@ -301,6 +317,18 @@ describe '
|
||||
click_button 'Add distributor'
|
||||
expect(page).to have_content "Permitted distributor"
|
||||
|
||||
within("tr.distributor-#{distributor_permitted.id}") { click_button 'Add fee' }
|
||||
expect(page).to have_select(
|
||||
"order_cycle_outgoing_exchange_1_enterprise_fees_0_enterprise_id", minimum: 1
|
||||
)
|
||||
select "Permitted distributor",
|
||||
from: "order_cycle_outgoing_exchange_1_enterprise_fees_0_enterprise_id"
|
||||
expect(page).to have_select(
|
||||
"order_cycle_outgoing_exchange_1_enterprise_fees_0_enterprise_fee_id",
|
||||
options: ["", distributor_permitted_fee1.name, distributor_permitted_fee2.name,
|
||||
distributor_permitted_fee3.name, distributor_permitted_fee4.name]
|
||||
)
|
||||
|
||||
expect(page).to have_input 'order_cycle_outgoing_exchange_0_pickup_time'
|
||||
fill_in 'order_cycle_outgoing_exchange_0_pickup_time', with: 'pickup time'
|
||||
fill_in 'order_cycle_outgoing_exchange_0_pickup_instructions', with: 'pickup instructions'
|
||||
|
||||
Reference in New Issue
Block a user