aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/api/redirect_to_test.rb
blob: 442cfcca6eb4cfd1c7b06577081b3fc4d6823e17 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true
require "abstract_unit"

class RedirectToApiController < ActionController::API
  def one
    redirect_to action: "two"
  end

  def two; end
end

class RedirectToApiTest < ActionController::TestCase
  tests RedirectToApiController

  def test_redirect_to
    get :one
    assert_response :redirect
    assert_equal "http://test.host/redirect_to_api/two", redirect_to_url
  end
end