And Here is the answer
require 'spec_helper'
describe "sessions" do
before do
FactoryGirl.create(:program)
@user = FactoryGirl.create(:user)
end
describe "user" do
it "is logged in" do
post "/api/v1/login", user_login: {email: @user.email, password: @user.password }
response.status.should be(201)
end
end
end
I'm not totally sure what's different than what I was doing in the question. I replaced the subject
block with a before
block and moved the creation of the program and user into Factories.