Sha256: 3bfeca7f329f94cc67887036add4261d45da1221da14905ccafcf9a83dc181f1

Contents?: true

Size: 1 KB

Versions: 144

Compression:

Stored size: 1 KB

Contents

require 'helper'

module Arel
  describe 'delete manager' do
    describe 'new' do
      it 'takes an engine' do
        Arel::DeleteManager.new Table.engine
      end
    end

    describe 'from' do
      it 'uses from' do
        table = Table.new(:users)
        dm = Arel::DeleteManager.new Table.engine
        dm.from table
        dm.to_sql.must_be_like %{ DELETE FROM "users" }
      end

      it 'chains' do
        table = Table.new(:users)
        dm = Arel::DeleteManager.new Table.engine
        dm.from(table).must_equal dm
      end
    end

    describe 'where' do
      it 'uses where values' do
        table = Table.new(:users)
        dm = Arel::DeleteManager.new Table.engine
        dm.from table
        dm.where table[:id].eq(10)
        dm.to_sql.must_be_like %{ DELETE FROM "users" WHERE "users"."id" = 10}
      end

      it 'chains' do
        table = Table.new(:users)
        dm = Arel::DeleteManager.new Table.engine
        dm.where(table[:id].eq(10)).must_equal dm
      end
    end
  end
end

Version data entries

144 entries across 126 versions & 16 rubygems

Version Path
swipe-rails-0.0.5 vendor/bundle/gems/arel-3.0.2/test/test_delete_manager.rb
active_mailer-0.0.9 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/test/test_delete_manager.rb
active_mailer-0.0.8 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/test/test_delete_manager.rb
active_mailer-0.0.7 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/test/test_delete_manager.rb
active_mailer-0.0.6 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/test/test_delete_manager.rb
challah-1.0.0.beta3 vendor/bundle/gems/arel-3.0.2/test/test_delete_manager.rb
arel-4.0.0 test/test_delete_manager.rb
fc-webicons-0.0.4 vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/test/test_delete_manager.rb
challah-1.0.0.beta2 vendor/bundle/gems/arel-3.0.2/test/test_delete_manager.rb
challah-1.0.0.beta vendor/bundle/gems/arel-3.0.2/test/test_delete_manager.rb
fc-webicons-0.0.3 vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/test/test_delete_manager.rb
fc-webicons-0.0.2 vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/test/test_delete_manager.rb
fc-webicons-0.0.1 vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/test/test_delete_manager.rb
arel-4.0.0.beta2 test/test_delete_manager.rb
arel-4.0.0.beta1 test/test_delete_manager.rb
active_mailer-0.0.5 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/test/test_delete_manager.rb
active_mailer-0.0.4 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/test/test_delete_manager.rb
active_mailer-0.0.3 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/test/test_delete_manager.rb
challah-0.9.1.beta.3 vendor/bundle/gems/arel-3.0.2/test/test_delete_manager.rb
devise_sociable-0.1.0 vendor/bundle/gems/arel-3.0.2/test/test_delete_manager.rb