Sha256: f7aecd34886e48573007b4739353326c09ac8f92a2b039e9528886c5c60f7286

Contents?: true

Size: 1 KB

Versions: 60

Compression:

Stored size: 1 KB

Contents

require 'rails_helper'

module PandaPal
  RSpec.describe Organization, type: :model do
    it 'creates a schema upon creation' do
      expect(Apartment::Tenant).to receive(:create)
      create :panda_pal_organization
    end

    it 'deletes a schema upon deletion' do
      expect(Apartment::Tenant).to receive(:create)
      expect(Apartment::Tenant).to receive(:drop)
      org = create :panda_pal_organization
      org.destroy
    end

    it 'does not allow the name to be changed after creation' do
      org = create :panda_pal_organization
      org.name = 'test123'
      expect(org.valid?).to be_falsey
    end

    it 'requires a salesforce_id' do
      org = build :panda_pal_organization, salesforce_id: nil
      expect(org.valid?).to be_falsey
    end

    it 'does not allow duplicate salesforce ids' do
      org = create :panda_pal_organization, salesforce_id: 'salesforce'
      org2 = build :panda_pal_organization, salesforce_id: 'salesforce'
      expect(org2.valid?).to be_falsey
    end
  end
end

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
panda_pal-5.3.10 spec/models/panda_pal/organization_spec.rb
panda_pal-5.3.9 spec/models/panda_pal/organization_spec.rb
panda_pal-5.3.7 spec/models/panda_pal/organization_spec.rb
panda_pal-5.3.6 spec/models/panda_pal/organization_spec.rb
panda_pal-5.3.6.beta3 spec/models/panda_pal/organization_spec.rb
panda_pal-5.3.6.beta2 spec/models/panda_pal/organization_spec.rb
panda_pal-5.3.6.beta1 spec/models/panda_pal/organization_spec.rb
panda_pal-5.3.5 spec/models/panda_pal/organization_spec.rb
panda_pal-5.3.4 spec/models/panda_pal/organization_spec.rb
panda_pal-5.3.2 spec/models/panda_pal/organization_spec.rb
panda_pal-5.3.0 spec/models/panda_pal/organization_spec.rb
panda_pal-5.2.5 spec/models/panda_pal/organization_spec.rb
panda_pal-5.2.4 spec/models/panda_pal/organization_spec.rb
panda_pal-5.2.3 spec/models/panda_pal/organization_spec.rb
panda_pal-5.2.2 spec/models/panda_pal/organization_spec.rb
panda_pal-5.2.1 spec/models/panda_pal/organization_spec.rb
panda_pal-5.2.0 spec/models/panda_pal/organization_spec.rb
panda_pal-5.1.0 spec/models/panda_pal/organization_spec.rb
panda_pal-4.1.0.beta3 spec/models/panda_pal/organization_spec.rb
panda_pal-4.1.0.beta2 spec/models/panda_pal/organization_spec.rb