mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Test adding suppliers
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
%td= order_cycle_form.text_field :orders_open_at, :class => 'datetimepicker', :value => order_cycle.orders_open_at
|
||||
%td= order_cycle_form.text_field :orders_close_at, :class => 'datetimepicker', :value => order_cycle.orders_close_at
|
||||
%td= order_cycle.coordinator.name
|
||||
%td
|
||||
%td.suppliers
|
||||
- order_cycle.suppliers.each do |s|
|
||||
= s.name
|
||||
%br/
|
||||
|
||||
@@ -31,19 +31,24 @@ feature %q{
|
||||
end
|
||||
|
||||
scenario "creating an order cycle" do
|
||||
# Given a coordinating enterprise
|
||||
# Given a coordinating enterprise and a supplying enterprise
|
||||
create(:enterprise, name: 'My coordinator')
|
||||
create(:supplier_enterprise, name: 'My supplier')
|
||||
|
||||
# When I go to the new order cycle page
|
||||
login_to_admin_section
|
||||
click_link 'Order Cycles'
|
||||
click_link 'New Order Cycle'
|
||||
|
||||
# And I fill in the basic fields and click Create
|
||||
# And I fill in the basic fields
|
||||
fill_in 'order_cycle_name', with: 'Plums & Avos'
|
||||
fill_in 'order_cycle_orders_open_at', with: '2012-11-06 06:00:00'
|
||||
fill_in 'order_cycle_orders_close_at', with: '2012-11-13 17:00:00'
|
||||
select 'My coordinator', from: 'order_cycle_coordinator_id'
|
||||
|
||||
# And I add a supplier and click Create
|
||||
select 'My supplier', from: 'new_supplier_id'
|
||||
click_button 'Add supplier'
|
||||
click_button 'Create'
|
||||
|
||||
# Then my order cycle should have been created
|
||||
@@ -54,6 +59,8 @@ feature %q{
|
||||
page.should have_selector "input[value='2012-11-06 06:00:00 UTC']"
|
||||
page.should have_selector "input[value='2012-11-13 17:00:00 UTC']"
|
||||
page.should have_content 'My coordinator'
|
||||
|
||||
page.should have_selector 'td.suppliers', text: 'My supplier'
|
||||
end
|
||||
|
||||
scenario "updating many order cycle opening/closing times at once" do
|
||||
|
||||
Reference in New Issue
Block a user