From 592ac7856a80c1c2e6ed014822f0713ec92acbc9 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Fri, 9 Jan 2015 10:58:35 +1100 Subject: [PATCH] Variable naming --- .../user_balance_calculator_spec.rb | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/spec/lib/open_food_network/user_balance_calculator_spec.rb b/spec/lib/open_food_network/user_balance_calculator_spec.rb index 192f0278c9..9bb8b0bef2 100644 --- a/spec/lib/open_food_network/user_balance_calculator_spec.rb +++ b/spec/lib/open_food_network/user_balance_calculator_spec.rb @@ -6,32 +6,32 @@ module OpenFoodNetwork describe "finding the account balance of a user with a hub" do - let!(:usr) { create(:user) } - let!(:entrprs) { create(:distributor_enterprise) } + let!(:user1) { create(:user) } + let!(:hub1) { create(:distributor_enterprise) } - let!(:o1) { create(:order_with_totals_and_distribution, user: usr, distributor: entrprs) } #total=10 - let!(:o2) { create(:order_with_totals_and_distribution, user: usr, distributor: entrprs) } #total=10 + let!(:o1) { create(:order_with_totals_and_distribution, user: user1, distributor: hub1) } #total=10 + let!(:o2) { create(:order_with_totals_and_distribution, user: user1, distributor: hub1) } #total=10 let!(:p1) { create(:payment, order: o1, amount: 15.00) } let!(:p2) { create(:payment, order: o2, amount: 10.00) } it "finds the user balance for this enterprise" do - UserBalanceCalculator.new(usr, entrprs).balance.to_i.should == 5 + UserBalanceCalculator.new(user1, hub1).balance.to_i.should == 5 end it "does not find the balance for other enterprises" do - entrprs2 = create(:distributor_enterprise) + hub2 = create(:distributor_enterprise) o3 = create(:order_with_totals_and_distribution, - user: usr, distributor: entrprs2) #total=10 + user: user1, distributor: hub2) #total=10 p3 = create(:payment, order: o3, amount: 10.00) - UserBalanceCalculator.new(usr, entrprs2).balance.to_i.should == 0 + UserBalanceCalculator.new(user1, hub2).balance.to_i.should == 0 end it "does not find the balance for other users" do - usr2 = create(:user) + user2 = create(:user) o4 = create(:order_with_totals_and_distribution, - user: usr2, distributor: entrprs) #total=10 + user: user2, distributor: hub1) #total=10 p3 = create(:payment, order: o4, amount: 20.00) - UserBalanceCalculator.new(usr2, entrprs).balance.to_i.should == 10 + UserBalanceCalculator.new(user2, hub1).balance.to_i.should == 10 end end end