Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- RSpec.describe "Authentications", :type => :request do
- it "should return 200 ok for valid user" do
- user = User.create(email: "bob@bob.com", password: "thisisapass",
- password_confirmation: "thisisapass", session_token: "ABCDEFG")
- headers = {
- "ACCEPT" => "application/json", # This is what Rails 4 accepts
- }
- post "/authenticate", :params => { :authentication =>{:user_id=> "1", :session_token => "ABCDEFG" }}, :headers => headers
- expect(response.content_type).to eq("application/json")
- expect(response).to have_http_status(:ok)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement