From cd6d7c76f6c7aab0120f628e3f27e90616d36256 Mon Sep 17 00:00:00 2001 From: Rob Harrington Date: Sat, 14 Oct 2017 16:53:07 +1100 Subject: [PATCH] Fix spec that requires preference persistence --- app/models/enterprise.rb | 1 + spec/features/admin/enterprises_spec.rb | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/app/models/enterprise.rb b/app/models/enterprise.rb index 95fb6461cc..0afa4c6e66 100644 --- a/app/models/enterprise.rb +++ b/app/models/enterprise.rb @@ -10,6 +10,7 @@ class Enterprise < ActiveRecord::Base # This is hopefully a temporary measure, pending the arrival of multiple named inventories # for shops. We need this here to allow hubs to restrict visible variants to only those in # their inventory if they so choose + # TODO: delegate this to a separate model instead of abusing Preferences. preference :product_selection_from_inventory_only, :boolean, default: false devise :confirmable, reconfirmable: true, confirmation_keys: [ :id, :email ] diff --git a/spec/features/admin/enterprises_spec.rb b/spec/features/admin/enterprises_spec.rb index 55f957b6be..d50cffd80f 100644 --- a/spec/features/admin/enterprises_spec.rb +++ b/spec/features/admin/enterprises_spec.rb @@ -273,6 +273,10 @@ feature %q{ before do Delayed::Job.destroy_all quick_login_as_admin + + # This test relies on preference persistence, so we'll turn it on for this spec only. + # It will be turned off again automatically by reset_spree_preferences in spec_helper. + Spree::Preferences::Store.instance.persistence = true end it "refreshes the cache when I change what products appear on my shopfront" do