Sha256: 5efe472eb09cb9847afd7af2f72c1ad17d09da5f604217c40c65d6ddde029ad8

Contents?: true

Size: 580 Bytes

Versions: 10

Compression:

Stored size: 580 Bytes

Contents

require 'spec_helper'

describe MultiTenant, 'Record modifications' do
  let(:account) { Account.create! name: 'test' }
  let(:project) { account.projects.create! name: 'something' }

  it 'includes the tenant_id in DELETEs' do
    project.destroy
    MultiTenant.with(account) do
      expect(Project.where(id: project.id).first).not_to be_present
    end
  end

  it 'includes the tenant_id in UPDATEs' do
    project.name = 'something else'
    project.save!
    MultiTenant.with(account) do
      expect(Project.find(project.id).name).to eq 'something else'
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
activerecord-multi-tenant-1.0.2 spec/activerecord-multi-tenant/record_modifications_spec.rb
activerecord-multi-tenant-1.0.1 spec/activerecord-multi-tenant/record_modifications_spec.rb
activerecord-multi-tenant-1.0.0 spec/activerecord-multi-tenant/record_modifications_spec.rb
activerecord-multi-tenant-0.11.0 spec/activerecord-multi-tenant/record_modifications_spec.rb
activerecord-multi-tenant-0.10.0 spec/activerecord-multi-tenant/record_modifications_spec.rb
activerecord-multi-tenant-0.9.0 spec/activerecord-multi-tenant/record_modifications_spec.rb
activerecord-multi-tenant-0.8.1 spec/activerecord-multi-tenant/record_modifications_spec.rb
activerecord-multi-tenant-0.8.0 spec/activerecord-multi-tenant/record_modifications_spec.rb
activerecord-multi-tenant-0.7.0 spec/activerecord-multi-tenant/record_modifications_spec.rb
activerecord-multi-tenant-0.6.0 spec/activerecord-multi-tenant/record_modifications_spec.rb