mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-10-27 17:28:26 -04:00
Update params in seeds controller spec
This commit is contained in:
1 parent
0acb054004
commit
8dfb8ff954
1 file changed
+9
-5
@@ -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
|
||||
|
||||
Reference in new issue
Block a user