From 30eb11ad84e7333b7c5799c71dc5668263da30e6 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Wed, 8 Jan 2014 11:38:21 +1100 Subject: [PATCH] Allow select_distribution to take no order_cycle --- spec/support/request/distribution_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/support/request/distribution_helper.rb b/spec/support/request/distribution_helper.rb index 57512562a8..a35c4d0c61 100644 --- a/spec/support/request/distribution_helper.rb +++ b/spec/support/request/distribution_helper.rb @@ -1,12 +1,12 @@ module OpenFoodNetwork module DistributionHelper - def select_distribution(distributor, order_cycle) + def select_distribution(distributor, order_cycle=nil) create_enterprise_group_for distributor visit root_path click_link distributor.name - if page.has_select? 'order_order_cycle_id' + if order_cycle && page.has_select?('order_order_cycle_id') select_by_value order_cycle.id, from: 'order_order_cycle_id' end end