<commit_before>require 'rails_helper'

describe "gardens/show" do
  before(:each) do
    @owner = FactoryBot.create(:member)
    controller.stub(:current_user) { @owner }
    @garden   = FactoryBot.create(:garden, owner: @owner)
    @planting = FactoryBot.create(:planting, garden: @garden, owner: @garden.owner)
    assign(:garden, @garden)
    assign(:current_plantings, [@planting])
    assign(:finished_plantings, [])
    render
  end

  it 'shows the location' do
    expect(rendered).to have_content @garden.location
  end

  it 'shows the area' do
    expect(rendered).to have_content pluralize(@garden.area, @garden.area_unit)
  end

  it 'shows the description' do
    expect(rendered).to have_content "totally cool garden"
  end

  it 'renders markdown in the description' do
    assert_select "strong", "totally"
  end

  it 'shows plantings on the garden page' do
    expect(rendered).to have_content @planting.crop.name
  end

  it "doesn't show the note about random plantings" do
    expect(rendered).to have_content "Note: these are a random selection"
  end

  context 'signed in' do
    before :each do
      sign_in @owner
      render
    end

    it "links to the right crop in the planting link" do
      assert_select("a[href='#{new_planting_path}?garden_id=#{@garden.id}']")
    end
  end
end<commit_msg>Removed outdated spec<commit_after>require 'rails_helper'

describe "gardens/show" do
  before(:each) do
    @owner = FactoryBot.create(:member)
    controller.stub(:current_user) { @owner }
    @garden   = FactoryBot.create(:garden, owner: @owner)
    @planting = FactoryBot.create(:planting, garden: @garden, owner: @garden.owner)
    assign(:garden, @garden)
    assign(:current_plantings, [@planting])
    assign(:finished_plantings, [])
    render
  end

  it 'shows the location' do
    expect(rendered).to have_content @garden.location
  end

  it 'shows the area' do
    expect(rendered).to have_content pluralize(@garden.area, @garden.area_unit)
  end

  it 'shows the description' do
    expect(rendered).to have_content "totally cool garden"
  end

  it 'renders markdown in the description' do
    assert_select "strong", "totally"
  end

  it 'shows plantings on the garden page' do
    expect(rendered).to have_content @planting.crop.name
  end

  context 'signed in' do
    before :each do
      sign_in @owner
      render
    end

    it "links to the right crop in the planting link" do
      assert_select("a[href='#{new_planting_path}?garden_id=#{@garden.id}']")
    end
  end
end
{'fraction_non_alphanumeric': 0.10640822784810126, 'fraction_numerical': 0.0, 'mean_word_length': 3.7271028037383176, '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': '6014944', 'n_tokens_mistral': 854, 'n_tokens_neox': 818, 'n_words': 233}