Sha256: 4b92fcc96e45dd6a4bb44c3948f6f5c544052ccee2322cfa37eefb821d213cfd

Contents?: true

Size: 972 Bytes

Versions: 3

Compression:

Stored size: 972 Bytes

Contents

require File.dirname(__FILE__) + '/../../spec_helper.rb'

describe "OracleEnhancedAdapter composite_primary_keys support" do

  before(:all) do
    require "composite_primary_keys"
    ActiveRecord::Base.establish_connection(CONNECTION_PARAMS)
    class JobHistory < ActiveRecord::Base
      set_table_name "job_history"
      set_primary_keys :employee_id, :start_date
    end
  end

  after(:all) do
    Object.send(:remove_const, 'CompositePrimaryKeys') if defined?(CompositePrimaryKeys)
    Object.send(:remove_const, 'JobHistory') if defined?(JobHistory)
  end

  it "should tell ActiveRecord that count distinct is not supported" do
    ActiveRecord::Base.connection.supports_count_distinct?.should be_false
  end
  
  it "should execute correct SQL COUNT DISTINCT statement on table with composite primary keys" do
    lambda { JobHistory.count(:distinct => true) }.should_not raise_error
  end

  # Other testing was done based on composite_primary_keys tests

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rsim-activerecord-oracle_enhanced-adapter-1.1.9.90 spec/active_record/connection_adapters/oracle_enhanced_cpk_spec.rb
rsim-activerecord-oracle_enhanced-adapter-1.1.9.91 spec/active_record/connection_adapters/oracle_enhanced_cpk_spec.rb
rsim-activerecord-oracle_enhanced-adapter-1.1.9.92 spec/active_record/connection_adapters/oracle_enhanced_cpk_spec.rb