Sha256: be46d73f28f4a0627c21b2ea05466df61ebacd3a37b142d3950cf5a0fa2950b3
Contents?: true
Size: 1.06 KB
Versions: 12
Compression:
Stored size: 1.06 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 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 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
12 entries across 12 versions & 1 rubygems