lk | doesn't display clients without agencies on the print select page

This commit is contained in:
Louis Knapp
2016-07-30 20:35:22 -05:00
parent b7090dba0d
commit ba23905e20
5 changed files with 20 additions and 2 deletions
@@ -8,6 +8,16 @@ describe ClientsController do
sign_in user
end
describe "#print_select" do
it "only assigns clients with a bike and an agency" do
client_with_bike_and_agency = create :client, bike: create(:bike), agency: create(:agency)
create :client, bike: create(:bike)
create :client, agency: create(:agency)
get :print_select
expect(assigns(:clients)).to eq [client_with_bike_and_agency]
end
end
describe "PUT #update" do
xit "updates a client with an application date" do
put :update, id: client.id, client: {application_date: "12/21/2015"}
+5
View File
@@ -0,0 +1,5 @@
FactoryGirl.define do
factory :agency do
sequence(:name) { |n| "Agency #{n}" }
end
end
-1
View File
@@ -4,6 +4,5 @@ FactoryGirl.define do
last_name "Doe"
application_date Date.new(2010, 03, 02)
gender "Male"
end
end