Sha256: 3b0ddaf7288007a7743625944e036c9f6e0eb41decebf478934be0e45da5d0ca

Contents?: true

Size: 1.53 KB

Versions: 13

Compression:

Stored size: 1.53 KB

Contents

# encoding: utf-8
require 'spec_helper'

describe Configuration::Type do
  
  before(:each) do
    @field = stub :field, :type= => nil, :virtual? => false
    @field.stub! :dup => @field
    
    @virtual_field = stub :virtual_field, :type= => nil, :virtual? => true
    @virtual_field.stub! :dup => @virtual_field
    @type = Configuration::Type.new :some_name,
                                    :some_indexing_select,
                                    @field,
                                    @virtual_field,
                                    :after_indexing => "some after indexing",
                                    :result_type => :some_result_type,
                                    :weights => :some_weights,
                                    :ignore_unassigned_tokens => :some_ignore_unassigned_tokens_option,
                                    :solr => :some_solr_option
  end
  
  # describe 'solr_fields' do
  #   it 'should return all non-virtual fields' do
  #     @type.solr_fields.should == [@field]
  #   end
  # end
  
  # describe 'index_solr' do
  #   it 'should get a new solr indexer and start it' do
  #     solr = mock :solr
  #     Indexers::Solr.should_receive(:new).once.with(@type).and_return solr
  #     
  #     solr.should_receive(:index).once.with
  #     
  #     @type.index_solr
  #   end
  # end
  
  describe 'index' do
    it 'should index each of the fields' do
      @field.should_receive(:index).once.with
      @virtual_field.should_receive(:index).once.with
      
      @type.index
    end
  end
  
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
picky-0.10.5 spec/lib/configuration/type_spec.rb
picky-0.10.4 spec/lib/configuration/type_spec.rb
picky-0.10.2 spec/lib/configuration/type_spec.rb
picky-0.10.1 spec/lib/configuration/type_spec.rb
picky-0.10.0 spec/lib/configuration/type_spec.rb
picky-0.9.4 spec/lib/configuration/type_spec.rb
picky-0.9.3 spec/lib/configuration/type_spec.rb
picky-0.9.2 spec/lib/configuration/type_spec.rb
picky-0.9.1 spec/lib/configuration/type_spec.rb
picky-0.9.0 spec/lib/configuration/type_spec.rb
picky-0.3.0 spec/lib/configuration/type_spec.rb
picky-0.2.4 spec/lib/configuration/type_spec.rb
picky-0.2.3 spec/lib/configuration/type_spec.rb