For my project, I need to add the header HTTP_ACCEPT
to all my requests.
Is there a solution to avoid this on all my controllers' specs ?
before do
@request.env["HTTP_ACCEPT"] = 'application/json'
end
Found it !
Rspec.configure do |config|
config.before(:each) do |example|
if example.metadata[:type] == :controller
controller.request.env["HTTP_ACCEPT"] = 'application/json'
end
end
end