Sha256: c8a843576fc9b9c5c3ae5b863a48861c6d4a0dd796a6be5e19d4eb05175c2502

Contents?: true

Size: 714 Bytes

Versions: 18

Compression:

Stored size: 714 Bytes

Contents

require 'spec_helper'

describe ActiveForce::SObject do
  describe '#table_name' do
    it 'Use the class name adding "__c"' do
      expect(Custom.table_name).to eq('Custom__c')
    end

    it 'with standard SObject types it does not add the "__c"' do
      expect(Account.table_name).to eq('Account')
    end

    it 'can be enforced in the class definition' do
      expect(EnforcedTableName.table_name).to eq('Forced__c')
    end

    context 'with a namespace' do
      it "the namespace is not included" do
        expect(Foo::Bar.table_name).to eq('Bar__c')
      end

      it 'standard types are inferred correctly' do
        expect(Foo::Account.table_name).to eq('Account')
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
openstax_active_force-1.1.1 spec/active_force/sobject/table_name_spec.rb
active_force-0.24.0 spec/active_force/sobject/table_name_spec.rb
active_force-0.23.0 spec/active_force/sobject/table_name_spec.rb
active_force-0.22.1 spec/active_force/sobject/table_name_spec.rb
active_force-0.22.0 spec/active_force/sobject/table_name_spec.rb
active_force-0.21.0 spec/active_force/sobject/table_name_spec.rb
active_force-0.20.1 spec/active_force/sobject/table_name_spec.rb
active_force-0.20.0 spec/active_force/sobject/table_name_spec.rb
active_force-0.19.0 spec/active_force/sobject/table_name_spec.rb
active_force-0.18.0 spec/active_force/sobject/table_name_spec.rb
active_force-0.17.0 spec/active_force/sobject/table_name_spec.rb
active_force-0.16.0 spec/active_force/sobject/table_name_spec.rb
active_force-0.15.1 spec/active_force/sobject/table_name_spec.rb
active_force-0.15.0 spec/active_force/sobject/table_name_spec.rb
openstax_active_force-1.1.0 spec/active_force/sobject/table_name_spec.rb
openstax_active_force-1.0.0 spec/active_force/sobject/table_name_spec.rb
active_force-0.7.1 spec/active_force/sobject/table_name_spec.rb
active_force-0.7.0 spec/active_force/sobject/table_name_spec.rb