title: RSpec request spec for user_login via API
body: <p>I'm trying to write a request spec for my <code>user_login</code> API, but can't figure out how to get a valid user that doesn't return a wrong username or password <code>401</code> invalid error. </p>
  
  <p>Here is my spec:</p>
  
  <p>require 'spec_helper'</p>
  
  <pre><code>describe User do
    subject(:user) do
      Program.create!(name: 'test', gender: 'Female', goal_id: '1', experience_id: '1')
      User.create!(email: 'test@test.com', password: '12345678', password_confirmation: '12345678', goal_id: '1', experience_level_id: '1', gender: 'Female')
    end
  
    it "is logged in" do
      post "/api/v1/login", user_login: {email: 'test@test.com', password: '12345678' }
      response.status.should be(201)
    end
  </code></pre>
  
  <p>My understanding was that creating a User in the subject line would mean that my test would run against that user. Any idea what I'm doing wrong here? </p>