<commit_before>require 'spec_helper'

describe "members/show" do

  before(:each) do
    @member = FactoryGirl.create(:member)
    @time = @member.created_at

    # need @garden to render the page
    @garden = Garden.new
    render
  end

  it "shows account creation date" do
    rendered.should contain "Member since"
    rendered.should contain @time.strftime("%B %d, %Y")
  end

  it "contains a gravatar icon" do
    assert_select "img", :src => /gravatar\.com\/avatar/
  end

  context "no gardens" do
    it "shouldn't mention the name of a garden" do
      rendered.should_not contain "My Garden"
    end
  end

  context "signed in member" do
    before(:each) do
      sign_in @member
      render
    end

    it "contains a 'New Garden' link" do
      assert_select "a[href=#garden_new]", :text => "New Garden"
    end
  end

  context "member has a garden" do
    before(:each) do
      FactoryGirl.create(:garden, :owner => @member)
      render
    end

    it "displays a garden, if the member has one" do
      rendered.should contain "Garden"
    end
  end

end<commit_msg>Fixed up tests for garden display<commit_after>require 'spec_helper'

describe "members/show" do

  before(:each) do
    @member = FactoryGirl.create(:member)
    @time = @member.created_at

    # need @garden to render the page
    @garden = Garden.new
    render
  end

  it "shows account creation date" do
    rendered.should contain "Member since"
    rendered.should contain @time.strftime("%B %d, %Y")
  end

  it "contains a gravatar icon" do
    assert_select "img", :src => /gravatar\.com\/avatar/
  end

  it "shows the auto-created garden" do
    assert_select "li.active>a", :text => "Garden"
  end

  context "signed in member" do
    before(:each) do
      sign_in @member
      render
    end

    it "contains a 'New Garden' link" do
      assert_select "a[href=#garden_new]", :text => "New Garden"
    end
  end

end
{'fraction_non_alphanumeric': 0.10228452751817238, 'fraction_numerical': 0.0, 'mean_word_length': 2.831013916500994, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, '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': '5819223', 'n_tokens_mistral': 640, 'n_tokens_neox': 610, 'n_words': 210}