aboutsummaryrefslogblamecommitdiffstats
path: root/test/test_activerecord_compat.rb
blob: d8812096100f30713e20425b99326cc587739ecf (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
                









                                                      
                                
                 
                                                                                    



         
require 'helper'

module Arel
  describe 'activerecord compatibility' do
    describe 'select manager' do
      it 'provides wheres' do
        table   = Table.new :users
        manager = Arel::SelectManager.new Table.engine
        manager.where table[:id].eq 1
        manager.where table[:name].eq 'Aaron'

        manager.wheres.map { |x|
          x.value
        }.join(', ').must_equal "\"users\".\"id\" = 1, \"users\".\"name\" = 'Aaron'"
      end
    end
  end
end