mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-07-30 17:27:11 -04:00
* Refactor Seeds to remove Elasticsearch dependency This commit refactors the `SeedsController` and `Seed` model to remove dependency on Elasticsearch and Searchkick. Key changes: - Removed `SearchSeeds` concern from the `Seed` model. - Reimplemented `Seed.homepage_records` using ActiveRecord. - Refactored `SeedsController#index` to use ActiveRecord for filtering, eager loading, and pagination. - Deleted `app/models/concerns/search_seeds.rb`. - Updated relevant specs to remove Searchkick-specific tags and setup. Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com> * Remove Seed.reindex * Remove trait * Fix tests --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
34 lines
692 B
Ruby
34 lines
692 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'rails_helper'
|
|
|
|
describe SeedsController do
|
|
let(:owner) { create(:member) }
|
|
|
|
describe "GET index" do
|
|
describe "picks up owner from params" do
|
|
before do
|
|
get :index, params: { member_slug: owner.slug }
|
|
end
|
|
|
|
it { expect(assigns(:owner)).to eq(owner) }
|
|
end
|
|
end
|
|
|
|
describe 'GET new' do
|
|
before { sign_in owner }
|
|
|
|
it { expect(response).to be_successful }
|
|
|
|
context 'with parent planting' do
|
|
let!(:planting) { create(:planting, owner:) }
|
|
|
|
before do
|
|
get :new, params: { planting_slug: planting.to_param }
|
|
end
|
|
|
|
it { expect(assigns(:planting)).to eq(planting) }
|
|
end
|
|
end
|
|
end
|