-
Notifications
You must be signed in to change notification settings - Fork 13
Redirect tests
Daniel Heath edited this page Nov 8, 2016
·
2 revisions
To support SEO and to keep old URLs live as we change our application architecture, Akamai can be configured to serve redirects directly.
Core redirection matchers:
expect('http://example.com').to be_permanently_redirected_to "http://other.com
expect('http://example.com').to be_temporarily_redirected_to "http://other.com
Utility matchers for common redirects:
expect('http://example.com').to redirect_http_to_https
expect('http://example.com').to redirect_https_to_http
expect('http://example.com').to redirect_to_remove_trailing_slash
expect('http://example.com').to redirect_to_add_trailing_slash
There is also support for making assertions about page you are redirected to:
expect('http://example.com').to redirect_https_to_http.then redirect_to_add_trailing_slash.then be_successful