Sha256: a1ffb9b72c87c77e7c1395b48230076547e8c46fa83d51c2a06daece9e0c0599

Contents?: true

Size: 1.17 KB

Versions: 6

Compression:

Stored size: 1.17 KB

Contents

require 'test_helper'

class NavigationTest < ActionDispatch::IntegrationTest
  setup do
    Sublease.tenant_model = Tenant
    host! 'staging.example.com'
  end

  context 'when switch_on_domain set' do
    should 'change to the proper tenant' do
      Sublease.switch_on_subdomain = false
      Sublease.switch_on_subdomain_and_domain = false
      Sublease.switch_on_domain = true
      get '/'
      assert_response :success
      assert_select '#current_tenant_name',Sublease.current_tenant.name
    end
  end

  context 'when switch_on_subdomain set' do
    should 'change to the proper tenant' do
      Sublease.switch_on_domain = false
      Sublease.switch_on_subdomain_and_domain = false
      Sublease.switch_on_subdomain = true
      get '/'
      assert_response :success
      assert_select '#current_tenant_name','site2'
    end
  end

  context 'when switch_on_subdomain_and_domain set' do
    should 'change to the proper tenant' do
      Sublease.switch_on_domain = false
      Sublease.switch_on_subdomain = false
      Sublease.switch_on_subdomain_and_domain = true
      get '/'
      assert_response :success
      assert_select '#current_tenant_name','site2'
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sublease-0.3.0 test/integration/navigation_test.rb
sublease-0.2.3 test/integration/navigation_test.rb
sublease-0.2.2 test/integration/navigation_test.rb
sublease-0.2.1 test/integration/navigation_test.rb
sublease-0.2.0 test/integration/navigation_test.rb
sublease-0.1.1 test/integration/navigation_test.rb