Sha256: 1dd694980695536d19e04c3f291406d03662a68a0756bc55340950fd9f94fd94

Contents?: true

Size: 875 Bytes

Versions: 15

Compression:

Stored size: 875 Bytes

Contents

require 'spec_helper'

describe ThinkingSphinx::ActiveRecord::DatabaseAdapters::AbstractAdapter do
  let(:adapter)    {
    ThinkingSphinx::ActiveRecord::DatabaseAdapters::AbstractAdapter.new model
  }
  let(:model)      { double('model', :connection => connection) }
  let(:connection) { double('connection') }

  describe '#quote' do
    it "uses the model's connection to quote columns" do
      connection.should_receive(:quote_column_name).with('foo')

      adapter.quote 'foo'
    end

    it "returns the quoted value" do
      connection.stub :quote_column_name => '"foo"'

      adapter.quote('foo').should == '"foo"'
    end
  end

  describe '#quoted_table_name' do
    it "passes the method through to the model" do
      model.should_receive(:quoted_table_name).and_return('"articles"')

      adapter.quoted_table_name.should == '"articles"'
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
thinking-sphinx-3.2.0 spec/thinking_sphinx/active_record/database_adapters/abstract_adapter_spec.rb
thinking-sphinx-3.1.4 spec/thinking_sphinx/active_record/database_adapters/abstract_adapter_spec.rb
thinking-sphinx-3.1.3 spec/thinking_sphinx/active_record/database_adapters/abstract_adapter_spec.rb
thinking-sphinx-3.1.2 spec/thinking_sphinx/active_record/database_adapters/abstract_adapter_spec.rb
thinking-sphinx-3.1.1 spec/thinking_sphinx/active_record/database_adapters/abstract_adapter_spec.rb
thinking-sphinx-3.1.0 spec/thinking_sphinx/active_record/database_adapters/abstract_adapter_spec.rb
thinking-sphinx-3.0.6 spec/thinking_sphinx/active_record/database_adapters/abstract_adapter_spec.rb
thinking-sphinx-3.0.5 spec/thinking_sphinx/active_record/database_adapters/abstract_adapter_spec.rb
thinking-sphinx-3.0.4 spec/thinking_sphinx/active_record/database_adapters/abstract_adapter_spec.rb
thinking-sphinx-3.0.3 spec/thinking_sphinx/active_record/database_adapters/abstract_adapter_spec.rb
thinking-sphinx-3.0.2 spec/thinking_sphinx/active_record/database_adapters/abstract_adapter_spec.rb
thinking-sphinx-3.0.1 spec/thinking_sphinx/active_record/database_adapters/abstract_adapter_spec.rb
thinking-sphinx-3.0.0 spec/thinking_sphinx/active_record/database_adapters/abstract_adapter_spec.rb
thinking-sphinx-3.0.0.rc spec/thinking_sphinx/active_record/database_adapters/abstract_adapter_spec.rb
thinking-sphinx-3.0.0.pre spec/thinking_sphinx/active_record/database_adapters/abstract_adapter_spec.rb