class RedirectSSLTest

Public Instance Methods

assert_not_redirected(url, headers: {}, redirect: {}) click to toggle source
# File actionpack/test/dispatch/ssl_test.rb, line 17
def assert_not_redirected(url, headers: {}, redirect: {})
  self.app = build_app ssl_options: { redirect: redirect }
  get url, headers: headers
  assert_response :ok
end
assert_post_redirected(redirect: {}, from: "http://a/b?c=d", to: from.sub("http", "https")) click to toggle source
# File actionpack/test/dispatch/ssl_test.rb, line 34
def assert_post_redirected(redirect: {}, from: "http://a/b?c=d",
  to: from.sub("http", "https"))

  self.app = build_app ssl_options: { redirect: redirect }

  post from
  assert_response redirect[:status] || 307
  assert_redirected_to to
end
assert_redirected(redirect: {}, from: "http://a/b?c=d", to: from.sub("http", "https")) click to toggle source
# File actionpack/test/dispatch/ssl_test.rb, line 23
def assert_redirected(redirect: {}, from: "http://a/b?c=d", to: from.sub("http", "https"))
  redirect = { status: 301, body: [] }.merge(redirect)

  self.app = build_app ssl_options: { redirect: redirect }

  get from
  assert_response redirect[:status] || 301
  assert_redirected_to to
  assert_equal redirect[:body].join, @response.body
end