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.4.27 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.5.4 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.4.26 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.5.3 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.4.25 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.5.2 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.4.24 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.5.1 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.4.23 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.4.22 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.5.0 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.4.21 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.5.0.beta.1 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.4.20 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.4.19 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.4.18 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.4.17 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.4.16 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.4.15 test/integration/workarea/storefront/host_integration_test.rb
workarea-storefront-3.4.14 test/integration/workarea/storefront/host_integration_test.rb