Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2017
477
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. RSpec.describe "Authentications", :type => :request do
  2. it "should return 200 ok for valid user" do
  3. user = User.create(email: "bob@bob.com", password: "thisisapass",
  4. password_confirmation: "thisisapass", session_token: "ABCDEFG")
  5.  
  6.  
  7. headers = {
  8. "ACCEPT" => "application/json", # This is what Rails 4 accepts
  9.  
  10. }
  11. post "/authenticate", :params => { :authentication =>{:user_id=> "1", :session_token => "ABCDEFG" }}, :headers => headers
  12.  
  13. expect(response.content_type).to eq("application/json")
  14. expect(response).to have_http_status(:ok)
  15.  
  16. end
  17. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement