<commit_before>require "spec_helper"

describe Mongoid::NamedScope do

  describe ".named_scope" do

    class ::Person
      named_scope :doctors, {:where => {:title => 'Dr.'} }
      named_scope :old, criteria.where(:age.gt => 50)
    end

    before do
      @document = Person.create(:title => "Dr.", :age => 65, :terms => true)
    end

    after do
      Person.delete_all
    end

    context "accessing a single named scope" do

      it "returns the document" do
        Person.doctors.first.should == @document
      end

    end

    context "chaining named scopes" do

      it "returns the document" do<commit_msg>Broken ci server fun - first fix for index<commit_after>require "spec_helper"

describe Mongoid::NamedScope do

  describe ".named_scope" do

    class ::Person
      named_scope :doctors, {:where => {:title => 'Dr.'} }
      named_scope :old, criteria.where(:age.gt => 50)
    end

    before do
      @document = Person.create(:title => "Dr.", :age => 65, :terms => true, :ssn => "123-22-8346")
    end

    after do
      Person.delete_all
    end

    context "accessing a single named scope" do

      it "returns the document" do
        Person.doctors.first.should == @document
      end

    end

    context "chaining named scopes" do

      it "returns the document" do
{'fraction_non_alphanumeric': 0.11408882082695253, 'fraction_numerical': 0.013016845329249618, 'mean_word_length': 2.561307901907357, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 16, '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': '4772843', 'n_tokens_mistral': 427, 'n_tokens_neox': 387, 'n_words': 128}