Sha256: d750f223ad9bd01d5da5418ebdb8187601231176caea534a57ad520bac01e8a1
Contents?: true
Size: 662 Bytes
Versions: 10
Compression:
Stored size: 662 Bytes
Contents
require 'spec_helper' describe 'Don\'t stomp all over the default ActiveRecord queries' do let!(:adapter) { ActiveRecord::Base.connection } before do adapter.create_table :cars, :force => true do |t| t.string :make t.string :model t.timestamps end class Car < ActiveRecord::Base attr_accessible :make, :model end end after do adapter.drop_table :cars Object.send(:remove_const, :Car) end describe 'Where Queries' do describe 'Set query' do it '' do Car.where('id in (?)', [1,2]).to_sql.should eq "SELECT \"cars\".* FROM \"cars\" WHERE (id in (1,2))" end end end end
Version data entries
10 entries across 10 versions & 2 rubygems