text: I have a rspec test testing a controller action.
  class SalesController < ApplicationController
  def create
  # This redirect sends the user to SalesController#go_to_home
  redirect_to '/go_to_home'
  end
  def go_to_home
  redirect_to '/'
  end
  end
  RSpec.describe SalesController, type: :controller do
  include PathsHelper
  describe 'POST create' do
  post :create
  expect(response).to redirect_to '/'
  end
  end
  Expected response to be a redirect to <> but was a redirect to <>.
  Expected "" to be === "".
  /go_to_home
  Controller tests are effectively unit tests - you are testing the effect of calling a single action and what the expected behaviour of that action is.
  The
  create action does return a response back with a status code of
  302 and includes in the header a
  Location indicating the new URI, which in the case of calling create would be
  Location:
  This is as far as the controller test goes. It has emulated a call made from a browser to the create action and received the initial redirection.
  In the real world of course the browser would then navigate to the given location and would then hit the
  go_to_home action but this is beyond the scope of controller tests ... this is in the domain of integration testing.
  So, either,
  createaction, follow the redirection and test that you end up at '/'.
  expect(response).to redirect_to '/go_to_home'
  createaction to redirect directly to '/'