diff --git a/spec/factories/crop.rb b/spec/factories/crop.rb index 4be8c4f09..c2ba35046 100644 --- a/spec/factories/crop.rb +++ b/spec/factories/crop.rb @@ -54,6 +54,10 @@ FactoryGirl.define do factory :uppercasecrop do name "Swiss chard" end + + factory :autoloaded_crop do + creator "cropbot" + end #for testing crop request factory :crop_request do diff --git a/spec/features/plantings/planting_a_crop_spec.rb b/spec/features/plantings/planting_a_crop_spec.rb index bda85fadc..7001ad400 100644 --- a/spec/features/plantings/planting_a_crop_spec.rb +++ b/spec/features/plantings/planting_a_crop_spec.rb @@ -40,6 +40,14 @@ feature "Planting a crop", :js => true do expect(page).to have_content "Planting was successfully created" expect(page).to have_content "maize" end + + scenario "Editing a planting to add details" do + visit planting_path(planting) + click_link "Edit" + fill_in "Tell us more about it", :with => "Some extra notes" + click_button "Save" + expect(page).to have_content "Planting was successfully updated" + end scenario "Marking a planting as finished" do fill_autocomplete "crop", :with => "mai"