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.6.12 spec/models/panda_pal/organization_spec.rb
panda_pal-5.6.11 spec/models/panda_pal/organization_spec.rb
panda_pal-5.6.10 spec/models/panda_pal/organization_spec.rb
panda_pal-5.6.9 spec/models/panda_pal/organization_spec.rb
panda_pal-5.6.8 spec/models/panda_pal/organization_spec.rb
panda_pal-5.6.7 spec/models/panda_pal/organization_spec.rb
panda_pal-5.6.7.beta2 spec/models/panda_pal/organization_spec.rb
panda_pal-5.6.7.beta1 spec/models/panda_pal/organization_spec.rb
panda_pal-5.6.6 spec/models/panda_pal/organization_spec.rb
panda_pal-5.6.5 spec/models/panda_pal/organization_spec.rb
panda_pal-5.6.4 spec/models/panda_pal/organization_spec.rb
panda_pal-5.6.3 spec/models/panda_pal/organization_spec.rb
panda_pal-5.6.2 spec/models/panda_pal/organization_spec.rb
panda_pal-5.6.1 spec/models/panda_pal/organization_spec.rb
panda_pal-5.6.0 spec/models/panda_pal/organization_spec.rb
panda_pal-5.4.11 spec/models/panda_pal/organization_spec.rb
panda_pal-5.4.10 spec/models/panda_pal/organization_spec.rb
panda_pal-5.4.9 spec/models/panda_pal/organization_spec.rb
panda_pal-5.4.8 spec/models/panda_pal/organization_spec.rb
panda_pal-5.4.7 spec/models/panda_pal/organization_spec.rb