diff --git a/config/locales/en.yml b/config/locales/en.yml index 90ebd7788..08155ea5a 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1000,6 +1000,7 @@ en: save_seeds: Save seeds string: "%{crop} seeds belonging to %{owner}" added_to_stash: Successfully added %{crop} seed to your stash. + updated: Seed was successfully updated. unauthorized: create: all: Please sign in or sign up to create a %{subject}. diff --git a/spec/controllers/seeds_controller_spec.rb b/spec/controllers/seeds_controller_spec.rb index fad615529..4525a6c12 100644 --- a/spec/controllers/seeds_controller_spec.rb +++ b/spec/controllers/seeds_controller_spec.rb @@ -272,4 +272,15 @@ describe SeedsController do it { expect(assigns(:planting)).to eq(planting) } end end + + describe 'PATCH update' do + let!(:seed) { create(:seed, owner:) } + + before { sign_in owner } + + it 'updates seed and sets flash notice' do + patch :update, params: { slug: seed.to_param, seed: { description: 'Updated seed notes' } } + expect(flash[:notice]).to eq('Seed was successfully updated.') + end + end end