From d757ec4fae558b2e1f143f5b25581b5c2ebab29a Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Thu, 2 Jan 2020 21:06:27 +1300 Subject: [PATCH] Reindex crops, in crop browse feature spec --- spec/features/crops/browse_crops_spec.rb | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/spec/features/crops/browse_crops_spec.rb b/spec/features/crops/browse_crops_spec.rb index 07a0f5a4a..d44b42820 100644 --- a/spec/features/crops/browse_crops_spec.rb +++ b/spec/features/crops/browse_crops_spec.rb @@ -3,13 +3,16 @@ require 'rails_helper' describe "browse crops", :search do - let!(:tomato) { FactoryBot.create :tomato } - let!(:maize) { FactoryBot.create :maize } - let!(:pending_crop) { FactoryBot.create :crop_request } - let!(:rejected_crop) { FactoryBot.create :rejected_crop } + let!(:tomato) { FactoryBot.create :tomato, :reindex } + let!(:maize) { FactoryBot.create :maize, :reindex } + let!(:pending_crop) { FactoryBot.create :crop_request, :reindex } + let!(:rejected_crop) { FactoryBot.create :rejected_crop, :reindex } shared_examples 'shows crops' do - before { visit crops_path } + before do + Crop.reindex + visit crops_path + end it "has a form for sorting by" do expect(page).to have_css "select#sort"