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