Sha256: 5243ea122fda48b08751f870217e7d4d379fe1be72f61a6adff216f4120f948d

Contents?: true

Size: 864 Bytes

Versions: 62

Compression:

Stored size: 864 Bytes

Contents

require 'test_helper'

module Workarea
  module Storefront
    class HostIntegrationTest < Workarea::IntegrationTest
      setup :set_host
      teardown :teardown_revert_host

      def set_host
        @current = Workarea.config.host
        @current_enforce = Workarea.config.enforce_host

        Workarea.config.host = 'www.bar.com'
        Workarea.config.enforce_host = true
      end

      def teardown_revert_host
        Workarea.config.host = @current
        Workarea.config.enforce_host = @current_enforce
      end

      def test_redirects_if_the_request_host_does_not_match_the_configured_host
        host! 'www.foo.com'
        get storefront.root_path

        assert(response.redirect?)
        assert_equal(301, response.status)
        assert_equal("http://www.bar.com#{storefront.root_path}", response.location)
      end
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-storefront-3.5.15 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.4.36 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.5.14 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.4.35 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.5.13 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.4.34 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.5.12 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.4.33 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.5.11 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.5.10 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.4.32 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.5.9 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.4.31 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.5.8 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.4.30 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.5.7 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.4.29 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.5.6 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.4.28 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.5.5 test/integration/workarea/storefront/host_integration_test.rb