redirect_back fallback_location root_path rspec
RSpec.configure do |config|
config.include RedirectBack
end
redirect_back fallback_location root_path rspec
RSpec.configure do |config|
config.include RedirectBack
end
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
redirect_back fallback_location root_path rspec
module RedirectBack
def from(url)
request.env['HTTP_REFERER'] = url
end
end
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us