From 6f80102f790f59d1b80ff96c6e37d8b547c89406 Mon Sep 17 00:00:00 2001 From: Cesy Avon Date: Mon, 16 Feb 2015 12:27:18 +0000 Subject: [PATCH 1/2] Adding autoloaded crop factory for later testing --- spec/factories/crop.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spec/factories/crop.rb b/spec/factories/crop.rb index c6839e983..92ec03572 100644 --- a/spec/factories/crop.rb +++ b/spec/factories/crop.rb @@ -53,6 +53,10 @@ FactoryGirl.define do factory :uppercasecrop do name "Swiss chard" end + + factory :autoloaded_crop do + creator "cropbot" + end end From 8990e803a0fa466ada23b8f133331ea73aa84f7e Mon Sep 17 00:00:00 2001 From: Cesy Avon Date: Thu, 26 Feb 2015 17:28:26 +0000 Subject: [PATCH 2/2] Increasing coverage of plantings controller --- spec/features/plantings/planting_a_crop_spec.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spec/features/plantings/planting_a_crop_spec.rb b/spec/features/plantings/planting_a_crop_spec.rb index 16b47973f..81576cb0b 100644 --- a/spec/features/plantings/planting_a_crop_spec.rb +++ b/spec/features/plantings/planting_a_crop_spec.rb @@ -39,6 +39,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 => "m"