Sha256: d79ea78bd9902e04c22d4882454c6e805b5df346205b9096c81cc5db10ce1e73

Contents?: true

Size: 429 Bytes

Versions: 5

Compression:

Stored size: 429 Bytes

Contents

require 'spec_helper'

describe 'Ensure that we don\'t stomp on Active Record\'s queries' do
  describe '.where' do
    it 'generates IN clauses for non array columns' do
      query = Person.where(:id => [1,2,3]).to_sql

      query.should match /IN \(1, 2, 3\)/
    end

    it 'generates IN clauses for non array columns' do
      query = Person.where(:id => []).to_sql

      query.should match /WHERE 1=0/
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
postgres_ext-2.1.3 spec/queries/sanity_spec.rb
postgres_ext-2.1.2 spec/queries/sanity_spec.rb
postgres_ext-2.1.1 spec/queries/sanity_spec.rb
postgres_ext-2.1.0 spec/queries/sanity_spec.rb
postgres_ext-2.0.0 spec/queries/sanity_spec.rb