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.27 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.5.26 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.4.45 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.5.25 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.5.23 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.4.44 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.5.22 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.4.43 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.5.21 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.4.42 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.5.20 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.4.41 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.5.19 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.4.40 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.5.18 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.4.39 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.5.17 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.4.38 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.5.16 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.4.37 test/integration/workarea/storefront/host_integration_test.rb