<commit_before>require 'rails_helper'

describe PlantingsHelper do
  describe "display_planting" do

    before(:each) do
      @member = FactoryGirl.build(:member,
        :login_name => 'crop_lady'
      )
    end

    it "neither quantity nor planted from provided" do
      planting = FactoryGirl.build(:planting,
        :quantity => nil,
        :planted_from => '',
        :owner => @member
      )
      result = helper.display_planting(planting)
      result.should eq "crop_lady."
    end

    it "quantity not provided" do
      planting = FactoryGirl.build(:planting,
        :quantity => nil,
        :planted_from => 'seed',
        :owner => @member
      )
      result = helper.display_planting(planting)
      result.should eq "crop_lady planted seeds."
    end

    context "multiple quantity" do
      it "planted_from not provided" do
        planting = FactoryGirl.build(:planting,
          :quantity => 10,
          :planted_from => '',
          :owner => @member
        )
        result = helper.display_planting(planting)
        result.should eq "crop_lady planted 10 units."
      end

      it "planted_from provided" do
        planting = FactoryGirl.build(:planting,
          :quantity => 5,
          :planted_from => 'seed',
          :owner => @member
        )
        result = helper.display_planting(planting)
        result.should eq "crop_lady planted 5 seeds."
      end
    end

    context "single quantity" do
      it "planted_from not provided" do
        planting = FactoryGirl.build(:planting,
          :quantity => 1,
          :planted_from => '',
          :owner => @member
        )
        result = helper.display_planting(planting)
        result.should eq "crop_lady planted 1 unit."
      end

      it "planted_from provided" do
        planting = FactoryGirl.build(:planting,
          :quantity => 1,
          :planted_from => 'seed',
          :owner => @member
        )
        result = helper.display_planting(planting)
        result.should eq "crop_lady planted 1 seed."
      end

    end

  end
end<commit_msg>Updated Helper Spec to Match Coding Standards<commit_after>require 'rails_helper'

describe PlantingsHelper do
  describe "display_planting" do

    let!(:member) { FactoryGirl.build(:member, :login_name => 'crop_lady') }

    it "does not have a quantity nor a planted from value provided" do
      planting = FactoryGirl.build(:planting,
        :quantity => nil,
        :planted_from => '',
        :owner => member
      )
      result = helper.display_planting(planting)
      expect(result).to eq "crop_lady."
    end

    it "does not have a quantity provided" do
      planting = FactoryGirl.build(:planting,
        :quantity => nil,
        :planted_from => 'seed',
        :owner => member
      )
      result = helper.display_planting(planting)
      expect(result).to eq "crop_lady planted seeds."
    end

    context "when quantity is greater than 1" do
      it "does not have a planted from value provided" do
        planting = FactoryGirl.build(:planting,
          :quantity => 10,
          :planted_from => '',
          :owner => member
        )
        result = helper.display_planting(planting)
        expect(result).to eq "crop_lady planted 10 units."
      end

      it "does have a planted from value provided" do
        planting = FactoryGirl.build(:planting,
          :quantity => 5,
          :planted_from => 'seed',
          :owner => member
        )
        result = helper.display_planting(planting)
        expect(result).to eq "crop_lady planted 5 seeds."
      end
    end

    context "when quantity is 1" do
      it "does not have a planted from value provided" do
        planting = FactoryGirl.build(:planting,
          :quantity => 1,
          :planted_from => '',
          :owner => member
        )
        result = helper.display_planting(planting)
        expect(result).to eq "crop_lady planted 1 unit."
      end

      it "does have a planted from value provided" do
        planting = FactoryGirl.build(:planting,
          :quantity => 1,
          :planted_from => 'seed',
          :owner => member
        )
        result = helper.display_planting(planting)
        expect(result).to eq "crop_lady planted 1 seed."
      end

    end

  end
end
{'fraction_non_alphanumeric': 0.09750989062136374, 'fraction_numerical': 0.005119851058878288, 'mean_word_length': 2.1054913294797686, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7643818', 'n_tokens_mistral': 1295, 'n_tokens_neox': 1222, 'n_words': 342}