Update params in seeds controller spec

This commit is contained in:
Brenda Wallace committed 2020-01-08 08:10:16 +13:00
1 parent 0acb054004
commit 8dfb8ff954
1 file changed
+9 -5
+9 -5
View File
@@ -6,10 +6,11 @@ describe SeedsController, :search do
let(:owner) { FactoryBot.create(:member) }
describe "GET index" do
let(:owner) { FactoryBot.create(:member) }
describe "picks up owner from params" do
before { get :index, params: { member_slug: owner.slug } }
before do
Seed.reindex
get :index, params: { member_slug: owner.slug }
end
it { expect(assigns(:owner)).to eq(owner) }
end
@@ -25,9 +26,12 @@ describe SeedsController, :search do
end
context 'with parent planting' do
let(:planting) { FactoryBot.create :planting, owner: owner }
let!(:planting) { FactoryBot.create :planting, owner: owner }
before { get :new, params: { planting_id: planting.to_param } }
before do
Seed.reindex
get :new, params: { planting_slug: planting.to_param }
end
it { expect(assigns(:planting)).to eq(planting) }
end