Sha256: 6425ad16348bf1065feab2ad32e9b567692f408c360163d1b8400693923cdfa6

Contents?: true

Size: 599 Bytes

Versions: 42

Compression:

Stored size: 599 Bytes

Contents

require_relative "test_helper"

class MultiTenancyTest < Minitest::Test
  def setup
    skip unless defined?(Apartment)
  end

  def test_basic
    Apartment::Tenant.switch!("tenant1")
    store_names ["Product A"], Tenant
    Apartment::Tenant.switch!("tenant2")
    store_names ["Product B"], Tenant
    Apartment::Tenant.switch!("tenant1")
    assert_search "product", ["Product A"], {load: false}, Tenant
    Apartment::Tenant.switch!("tenant2")
    assert_search "product", ["Product B"], {load: false}, Tenant
  end

  def teardown
    Apartment::Tenant.reset if defined?(Apartment)
  end
end

Version data entries

42 entries across 42 versions & 4 rubygems

Version Path
searchkick-3.1.0 test/multi_tenancy_test.rb
searchkick-3.0.3 test/multi_tenancy_test.rb
searchkick_evichat-0.0.2 test/multi_tenancy_test.rb
searchkick-3.0.2 test/multi_tenancy_test.rb
searchkick-3.0.1 test/multi_tenancy_test.rb
searchkick-3.0.0 test/multi_tenancy_test.rb
searchkick-2.5.0 test/multi_tenancy_test.rb
searchkick-hooopo-2.4.1 test/multi_tenancy_test.rb
searchkick-hooopo-2.4.0 test/multi_tenancy_test.rb
searchkick-2.4.0 test/multi_tenancy_test.rb
searchkick-hooopo-2.3.5 test/multi_tenancy_test.rb
searchkick-2.3.2 test/multi_tenancy_test.rb
searchkick-hooopo-2.3.4 test/multi_tenancy_test.rb
searchkick-2.3.1 test/multi_tenancy_test.rb
searchkick-hooopo-2.3.3 test/multi_tenancy_test.rb
searchkick-hooopo-2.3.2 test/multi_tenancy_test.rb
searchkick-hooopo-2.3.1 test/multi_tenancy_test.rb
searchkick-hooopo-2.3.0 test/multi_tenancy_test.rb
searchkick-2.3.0 test/multi_tenancy_test.rb
searchkick-2.2.1 test/multi_tenancy_test.rb