<commit_before>require 'spec_helper'

describe DashboardGrid do
  let(:project) { Project.new }
  let(:aggregate_project) { AggregateProject.new }

  context "no tags" do
    before do
      Project.should_receive(:standalone).and_return [project]
      AggregateProject.should_receive(:all).and_return [aggregate_project]
    end

    it "assigns all projects and aggregate projects" do
      projects = DashboardGrid.generate
      projects.should include(project)
      projects.should include(aggregate_project)
    end
  end

  context "tags" do
    let!(:tagged_project) { FactoryGirl.create(:project, tag_list: "tag") }
    let!(:tagged_aggregate_project) { FactoryGirl.create(:aggregate_project, tag_list: "tag,awesome") }
    let!(:awesome_project) { FactoryGirl.create(:project, tag_list: "awesome", aggregate_project: tagged_aggregate_project) }
<commit_msg>Fix brittle spec<commit_after>require 'spec_helper'

describe DashboardGrid do
  let(:project) { FactoryGirl.build :project }
  let(:aggregate_project) { FactoryGirl.build :aggregate_project }

  context "no tags" do
    before do
      Project.should_receive(:standalone).and_return [project]
      AggregateProject.should_receive(:all).and_return [aggregate_project]
    end

    it "assigns all projects and aggregate projects" do
      projects = DashboardGrid.generate
      projects.should include(project)
      projects.should include(aggregate_project)
    end
  end

  context "tags" do
    let!(:tagged_project) { FactoryGirl.create(:project, tag_list: "tag") }
    let!(:tagged_aggregate_project) { FactoryGirl.create(:aggregate_project, tag_list: "tag,awesome") }
    let!(:awesome_project) { FactoryGirl.create(:project, tag_list: "awesome", aggregate_project: tagged_aggregate_project) }

{'fraction_non_alphanumeric': 0.10270880361173815, 'fraction_numerical': 0.0, 'mean_word_length': 4.8903654485049834, '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': '650845', 'n_tokens_mistral': 563, 'n_tokens_neox': 523, 'n_words': 110}