Change call to reindex crops in specs

This commit is contained in:
Brenda Wallace
2019-04-02 20:50:46 +13:00
parent c8716b6a1a
commit bd797a4d8e
4 changed files with 4 additions and 4 deletions

View File

@@ -10,7 +10,7 @@ describe "Harvesting a crop", :js, :elasticsearch do
before do
login_as member
visit new_harvest_path
sync_elasticsearch [maize]
maize.reindex
end
it_behaves_like "crop suggest", "harvest", "crop"

View File

@@ -12,7 +12,7 @@ describe "Planting a crop", :js, :elasticsearch do
before do
login_as member
visit new_planting_path
sync_elasticsearch [maize]
maize.reindex
end
it_behaves_like "crop suggest", "planting"

View File

@@ -8,7 +8,7 @@ describe "Seeds", :js, :elasticsearch do
before do
login_as member
visit new_seed_path
sync_elasticsearch [maize]
maize.reindex
end
it_behaves_like "crop suggest", "seed", "crop"

View File

@@ -6,7 +6,7 @@ shared_examples "crop suggest" do |resource|
let!(:tomato) { create :tomato }
let!(:roma) { create :roma }
before { sync_elasticsearch [pea, pear, maize, tomato] }
before { [pea, pear, maize, tomato].each{|crop| crop.reindex } }
scenario "placeholder text in crop auto suggest field" do
expect(page).to have_selector("input[placeholder='e.g. lettuce']")