From 1dc44c9edc698b1e2aa4c5c71ea1c7695717ec03 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Tue, 7 Feb 2017 18:28:48 +1300 Subject: [PATCH] Filled in the 3 pending planting specs --- spec/models/planting_spec.rb | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/spec/models/planting_spec.rb b/spec/models/planting_spec.rb index 327379fc3..e3bc1b66f 100644 --- a/spec/models/planting_spec.rb +++ b/spec/models/planting_spec.rb @@ -37,9 +37,18 @@ describe Planting do end describe '#planted?' do - it "should be false for future plantings" - it "should be false for never planted" - it "should be false for future plantings" + it "should be false for future plantings" do + planting = FactoryGirl.create :planting, planted_at: Time.zone.today + 1 + expect(planting.planted?).to eq(false) + end + it "should be false for never planted" do + planting = FactoryGirl.create :planting, planted_at: nil + expect(planting.planted?).to eq(false) + end + it "should be true for past plantings" do + planting = FactoryGirl.create :planting, planted_at: Time.zone.today - 1 + expect(planting.planted?).to eq(true) + end end describe '#percentage_grown' do