Sha256: 033b1a9587b3410497e5bf446948c8349f7ec69a5fe4d6ac3c5de1d4f2ba50b2

Contents?: true

Size: 805 Bytes

Versions: 11

Compression:

Stored size: 805 Bytes

Contents

require 'acceptance/spec_helper'

describe '64 bit integer support' do
  it "ensures all internal id attributes are big ints if one is" do
    large_index = ThinkingSphinx::ActiveRecord::Index.new(:tweet)
    large_index.definition_block = Proc.new {
      indexes text
    }

    small_index = ThinkingSphinx::ActiveRecord::Index.new(:article)
    small_index.definition_block = Proc.new {
      indexes title
    }

    ThinkingSphinx::Configuration::ConsistentIds.new(
      [small_index, large_index]
    ).reconcile

    large_index.sources.first.attributes.detect { |attribute|
      attribute.name == 'sphinx_internal_id'
    }.type.should == :bigint

    small_index.sources.first.attributes.detect { |attribute|
      attribute.name == 'sphinx_internal_id'
    }.type.should == :bigint
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
thinking-sphinx-3.1.1 spec/acceptance/big_integers_spec.rb
thinking-sphinx-3.1.0 spec/acceptance/big_integers_spec.rb
thinking-sphinx-3.0.6 spec/acceptance/big_integers_spec.rb
thinking-sphinx-3.0.5 spec/acceptance/big_integers_spec.rb
thinking-sphinx-3.0.4 spec/acceptance/big_integers_spec.rb
thinking-sphinx-3.0.3 spec/acceptance/big_integers_spec.rb
thinking-sphinx-3.0.2 spec/acceptance/big_integers_spec.rb
thinking-sphinx-3.0.1 spec/acceptance/big_integers_spec.rb
thinking-sphinx-3.0.0 spec/acceptance/big_integers_spec.rb
thinking-sphinx-3.0.0.rc spec/acceptance/big_integers_spec.rb
thinking-sphinx-3.0.0.pre spec/acceptance/big_integers_spec.rb