show all permitted enterprises in order cycle summery

This commit is contained in:
Rafael Schouten
2014-10-18 03:26:57 +11:00
parent 87cc1d6217
commit b71a40ae6d
2 changed files with 6 additions and 2 deletions

View File

@@ -5,12 +5,12 @@
%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.suppliers
- order_cycle.suppliers.managed_by(spree_current_user).each do |s|
- order_cycle.suppliers.merge(OpenFoodNetwork::Permissions.new(spree_current_user).order_cycle_enterprises).each do |s|
= s.name
%br/
%td= order_cycle.coordinator.name
%td.distributors
- order_cycle.distributors.managed_by(spree_current_user).each do |d|
- order_cycle.distributors.merge(OpenFoodNetwork::Permissions.new(spree_current_user).order_cycle_enterprises).each do |d|
= d.name
%br/

View File

@@ -471,6 +471,10 @@ feature %q{
# I should see only the order cycle I am coordinating
page.should have_content oc_user_coordinating.name
page.should_not have_content oc_for_other_user.name
# The order cycle should show enterprises that I manage
page.should have_selector 'td.suppliers', text: supplier_managed.name
page.should have_selector 'td.distributors', text: distributor_managed.name
# The order cycle should not show enterprises that I don't manage
page.should_not have_selector 'td.suppliers', text: supplier_unmanaged.name