mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-11 09:17:20 -04:00
* Rubocop: RSpec/EmptyExampleGroup * Undo renaming * Apply suggestion from @CloCkWeRX * Apply suggestion from @CloCkWeRX
36 lines
743 B
Ruby
36 lines
743 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'rails_helper'
|
|
|
|
describe SeedsController, :search do
|
|
let(:owner) { create(:member) }
|
|
|
|
describe "GET index" do
|
|
describe "picks up owner from params" do
|
|
before do
|
|
Seed.reindex
|
|
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
|
|
Seed.reindex
|
|
get :new, params: { planting_slug: planting.to_param }
|
|
end
|
|
|
|
it { expect(assigns(:planting)).to eq(planting) }
|
|
end
|
|
end
|
|
end
|