Sha256: a8d8510cea693a16d4b64c7382ba85e8bad1aac16d898d56f1d46215abd62d42

Contents?: true

Size: 591 Bytes

Versions: 7

Compression:

Stored size: 591 Bytes

Contents

# -*- encoding : utf-8 -*-
require 'spec_helper'

describe ActsAsTaggableOn::Utils do
  describe '#like_operator' do
    it 'should return \'ILIKE\' when the adapter is PostgreSQL' do
      allow(ActsAsTaggableOn::Utils.connection).to receive(:adapter_name) { 'PostgreSQL' }
      expect(ActsAsTaggableOn::Utils.like_operator).to eq('ILIKE')
    end

    it 'should return \'LIKE\' when the adapter is not PostgreSQL' do
      allow(ActsAsTaggableOn::Utils.connection).to receive(:adapter_name) { 'MySQL' }
      expect(ActsAsTaggableOn::Utils.like_operator).to eq('LIKE')
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
acts-as-taggable-on-3.4.2 spec/acts_as_taggable_on/utils_spec.rb
acts-as-taggable-on-3.4.1 spec/acts_as_taggable_on/utils_spec.rb
acts-as-taggable-on-3.4.0 spec/acts_as_taggable_on/utils_spec.rb
acts-as-taggable-on-3.3.0 spec/acts_as_taggable_on/utils_spec.rb
acts-as-taggable-on-3.2.6 spec/acts_as_taggable_on/utils_spec.rb
acts-as-taggable-on-3.2.5 spec/acts_as_taggable_on/utils_spec.rb
acts-as-taggable-on-3.2.4 spec/acts_as_taggable_on/utils_spec.rb