-2

I'm trying to write an integration test for my API. The request being made is:

delete sessions_path, session: { article_id: @article.id}

The request should however also include http headers:

Authorization: "mytoken"
My_email: @user.email

How to include these http headers?

Marty
  • 2,132
  • 4
  • 21
  • 47

1 Answers1

1

What about this:

delete sessions_path, {session: { article_id: @article.id}}, {"Authorization" => "mytoken", "My_email" => @user.email}

You can check this answer for more informations.

Community
  • 1
  • 1
mtkcs
  • 1,696
  • 14
  • 27
  • Thanks, I had searched but hadn't found the answer. It worked using `delete sessions_path, {session: { article_id: @article.id}}, {"Authorization" => "mytoken", "HTTP_MY_EMAIL" => @user.email}`. – Marty Jan 23 '16 at 11:36