adding headers to a rspec get
Unfortunately, rspec doesn't allow to set request headers, so you'll need to workaround it like this:
it "returns albums" do
request.headers.merge!(authenticated_header("admin", "123"))
get "/index", params: {}
puts response.body
end
If you get rid of the type: :controller
and switch to using the named route photo_path
instead of :index
it accepts the :headers
.