Answers for "redirect_back fallback_location root_path rspec"

0

redirect_back fallback_location root_path rspec

RSpec.configure do |config|
  config.include RedirectBack
end
Posted by: Guest on July-22-2020
0

redirect_back fallback_location root_path rspec

RSpec.describe InterestsController, type: :controller do
  describe 'POST #create' do
    context 'with valid attributes' do
      it 'redirects to referer' do
        from about_path
        post :create, params: { interest: attributes_for(:interest) }
        expect(response).to redirect_to about_url
      end
    end
  end
end
Posted by: Guest on July-22-2020
0

redirect_back fallback_location root_path rspec

module RedirectBack
  def from(url)
    request.env['HTTP_REFERER'] = url
  end
end
Posted by: Guest on July-22-2020

Code answers related to "redirect_back fallback_location root_path rspec"

Browse Popular Code Answers by Language