<commit_before>require File.expand_path('../../../spec_helper', __FILE__)

describe Admin::ProjectsController do

  def mock_project(stubs={})
    @mock_project.stub!(stubs) unless stubs.empty?
    @mock_project
  end

  before(:each) do
    generate_default_project_and_jnlps_with_mocks
    generate_portal_resources_with_mocks
    login_admin
  end

  describe "GET index" do
    it "assigns all admin_projects as @admin_projects" do
      Admin::Project.should_receive(:find).with(:all, hash_including(will_paginate_params)).and_return([mock_project])
      get :index
      assigns[:admin_projects].should == [mock_project]
    end<commit_msg>Fix spec: SearchableModel no longer calls find under the covers<commit_after>require File.expand_path('../../../spec_helper', __FILE__)

describe Admin::ProjectsController do

  def mock_project(stubs={})
    @mock_project.stub!(stubs) unless stubs.empty?
    @mock_project
  end

  before(:each) do
    generate_default_project_and_jnlps_with_mocks
    generate_portal_resources_with_mocks
    login_admin
  end

  describe "GET index" do
    it "assigns all admin_projects as @admin_projects" do
      Admin::Project.should_receive(:search).with(nil, nil, nil).and_return([mock_project])
      get :index
      assigns[:admin_projects].should == [mock_project]
    end
{'fraction_non_alphanumeric': 0.10250569476082004, 'fraction_numerical': 0.0, 'mean_word_length': 4.561181434599156, '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': '3101789', 'n_tokens_mistral': 416, 'n_tokens_neox': 409, 'n_words': 83}