Sha256: 8aedf626962e062255281bf2e18d5d4eb1a260972bdb34d5ef46736d0208800b

Contents?: true

Size: 697 Bytes

Versions: 10

Compression:

Stored size: 697 Bytes

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
      TestAfterCommit.with_commits(true) do
        expect(Apartment::Tenant).to receive(:create)
        expect(Apartment::Tenant).to receive(:drop)
        org = create :panda_pal_organization
        org.destroy
      end
    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
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
panda_pal-1.0.1 spec/models/panda_pal/organization_spec.rb
panda_pal-0.1.0 spec/models/panda_pal/organization_spec.rb
panda_pal-1.0.0 spec/models/panda_pal/organization_spec.rb
panda_pal-0.0.8 spec/models/panda_pal/organization_spec.rb
panda_pal-0.0.7 spec/models/panda_pal/organization_spec.rb
panda_pal-0.0.6 spec/models/panda_pal/organization_spec.rb
panda_pal-0.0.5 spec/models/panda_pal/organization_spec.rb
panda_pal-0.0.4 spec/models/panda_pal/organization_spec.rb
panda_pal-0.0.3 spec/models/panda_pal/organization_spec.rb
panda_pal-0.0.2 spec/models/panda_pal/organization_spec.rb