Define :oc with let so it is available globally to other methods such as :expect_fees_saved

This commit is contained in:
Cillian O'Ruanaidh
2022-09-21 21:44:01 +01:00
committed by Filipe
parent 23f6901fb4
commit 2827e07da6

View File

@@ -24,6 +24,7 @@ describe '
}
let!(:shipping_method_i) { distributor.shipping_methods.first }
let!(:shipping_method_ii) { create(:shipping_method, distributors: [distributor]) }
let(:oc) { OrderCycle.last }
# And some enterprise fees
let!(:supplier_fee) { create(:enterprise_fee, enterprise: supplier, name: 'Supplier fee') }
@@ -194,7 +195,6 @@ describe '
end
def expect_all_data_saved
oc = OrderCycle.last
toggle_columns "Producers", "Shops"
expect(page).to have_input "oc#{oc.id}[name]", value: "Plums & Avos"