Why is my functional test not being redirected as per route match/redirect?
===

I am redirecting a particular route, and it works in the browser, but not in tests.

**config/routes.rb**

    match '/campaigns' => redirect('/newsletters')               # note redirect
    resources :campaigns do

The following test should fail. It should not be able to get `campaigns#index` (but it does), and instead it should be redirected to `newsletters#index`. Any idea why this is happening?

**test/functional/campaigns_controller_test.rb**

    class CampaignsControllerTest < ActionController::TestCase
    rendering campaigns#index
      test "should get index" do
        get :index
        assert_response :success   # actually succeeds, but should fail due to redirect
      end

Really, I'm hoping to put something like `assert_redirected_to newsletters_path` (and change the name of the test to reflect that: `get index should redirect to newsletters`).

**app/controllers/campaigns_controller.rb**

Once the test of redirection works, I will get rid of this action.

    def index
      @campaigns = Campaign.all

      respond_to do |format|
        format.html # index.html.erb
        format.json { render json: @campaigns }
      end
    end
