<commit_before>require 'rails_helper'

describe Garden do
  let(:owner) { FactoryGirl.create(:member) }
  let(:garden) { FactoryGirl.create(:garden, owner: owner) }

  it "should have a slug" do
    garden.slug.should match(/member\d+-springfield-community-garden/)
  end

  it "should have a description" do
    garden.description.should == "This is a **totally** cool garden"
  end

  it "doesn't allow a nil name" do
    garden = FactoryGirl.build(:garden, name: nil)
    garden.should_not be_valid
  end

  it "doesn't allow a blank name" do
    garden = FactoryGirl.build(:garden, name: "")
    garden.should_not be_valid
  end

  it "allows numbers" do
    garden = FactoryGirl.build(:garden, name: "100 vines of 2 kamo-kamo")
    garden.should_not be_valid
  end

  it "allows macrons" do
    garden = FactoryGirl.build(:garden, name: "Kūmara and pūha patch")
    garden.should_not be_valid
  end

  it "doesn't allow a name with only spaces" do
    garden = FactoryGirl.build(:garden, name: "    ")
    garden.should_not be_valid
  end

  it "doesn't allow a new lines in garden names" do
    garden = FactoryGirl.build(:garden, name: "My garden\nI am a 1337 hacker")
    garden.should_not be_valid
  end

  it "should have an owner" do
    garden.owner.should be_an_instance_of Member
  end

  it "should stringify" do
    garden.to_s.should == "garden named \"#{garden.name}\" by #{garden.owner.login_name}"
  end

  context "featured plantings" do
    let(:tomato) { FactoryGirl.create(:tomato) }
    let(:maize) { FactoryGirl.create(:maize) }
    let(:chard) { FactoryGirl.create(:chard) }
    let(:apple) { FactoryGirl.create(:apple) }
    let(:pear)  { FactoryGirl.create(:pear) }<commit_msg>Revert "update spec for stringify"<commit_after>require 'rails_helper'

describe Garden do
  let(:owner) { FactoryGirl.create(:member) }
  let(:garden) { FactoryGirl.create(:garden, owner: owner) }

  it "should have a slug" do
    garden.slug.should match(/member\d+-springfield-community-garden/)
  end

  it "should have a description" do
    garden.description.should == "This is a **totally** cool garden"
  end

  it "doesn't allow a nil name" do
    garden = FactoryGirl.build(:garden, name: nil)
    garden.should_not be_valid
  end

  it "doesn't allow a blank name" do
    garden = FactoryGirl.build(:garden, name: "")
    garden.should_not be_valid
  end

  it "allows numbers" do
    garden = FactoryGirl.build(:garden, name: "100 vines of 2 kamo-kamo")
    garden.should_not be_valid
  end

  it "allows macrons" do
    garden = FactoryGirl.build(:garden, name: "Kūmara and pūha patch")
    garden.should_not be_valid
  end

  it "doesn't allow a name with only spaces" do
    garden = FactoryGirl.build(:garden, name: "    ")
    garden.should_not be_valid
  end

  it "doesn't allow a new lines in garden names" do
    garden = FactoryGirl.build(:garden, name: "My garden\nI am a 1337 hacker")
    garden.should_not be_valid
  end

  it "should have an owner" do
    garden.owner.should be_an_instance_of Member
  end

  it "should stringify as its name" do
    garden.to_s.should == garden.name
  end

  context "featured plantings" do
    let(:tomato) { FactoryGirl.create(:tomato) }
    let(:maize) { FactoryGirl.create(:maize) }
    let(:chard) { FactoryGirl.create(:chard) }
    let(:apple) { FactoryGirl.create(:apple) }
    let(:pear)  { FactoryGirl.create(:pear) }
{'fraction_non_alphanumeric': 0.11317418213969938, 'fraction_numerical': 0.004715590922487474, 'mean_word_length': 3.5618279569892475, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2197975', 'n_tokens_mistral': 1205, 'n_tokens_neox': 1145, 'n_words': 327}