Module: Musoni::TestHelper
- Defined in:
- lib/musoni_ruby/support/test_helper.rb
Instance Method Summary collapse
- #create_borrower_datatable ⇒ Object
- #create_client_datatable ⇒ Object
- #create_firstaccess_datatable ⇒ Object
- #create_musoni_client ⇒ Object
- #create_musoni_loan ⇒ Object
- #create_musoni_savings_account ⇒ Object
- #create_transunion_datatable ⇒ Object
Instance Method Details
#create_borrower_datatable ⇒ Object
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
# File 'lib/musoni_ruby/support/test_helper.rb', line 85 def create_borrower_datatable client = create_musoni_client datatable_attributes = { :town=>"Nairobi", :address=>"Waiyaki Way", :MaritalStatus_cv_maritalStatus=>"Single", :dateOfBirth=>"01-01-1900", :state=>"state", :E_mail_address=> Faker::Internet.email, :Password=> Faker::Internet.password, :Sector=>"Sector1", :occupation=>"Something", :children_present=>"yes", :household_size=>"10", :dependants_no=>"5", :household_assets=>"None", :monthly_expense_food=>"100", :monthly_expense_housing=>"500", :monthly_expense_school=>"150", :monthly_expense_medical=>"200", :monthly_expense_tranport=>"230", :monthly_expense_health=>"320", :business_ownership=>"Yes", :business_experience=>"10", :book_keeping=>"yes", :monthly_reorder_level=>"10", :current_inventory_level=>"10", :active_savings_devices=>"m-shwari,something else,3rd option", :savings_emergency=>"1001", :savings_school=>"1001", :savings_asset=>"100", :savings_entertainment=>"200", :savings_medical=>"400", :savings_business=>"500", :savings_other=>"100", :credit_limit_mshwari=>"100000000", :saving_frequency=>"None", :remittance_amount=>"1000", :remittance_location=>"Yaya", :remittance_frequency=>"daily", :mobile_use=>"yes", :last_mmoney_out=>"today", :last_mmoney_in=>"yesterday", :phones_owned=>"10", :language_use=>"English,Dutch", :data_mpesa=>"Mledger BLOB", :income_weekly=>10000, :survey_id=>123, :dateFormat=>"dd-MM-yyyy", :locale=>"en_GB" } @@musoni_borrower_datatable ||= Musoni::Datatable.create(:cct_Borrower_Details,client.id,datatable_attributes) end |
#create_client_datatable ⇒ Object
71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/musoni_ruby/support/test_helper.rb', line 71 def create_client_datatable client = create_musoni_client datatable_attributes = { :MaritalStatus_cv_maritalStatus=>"Single", :dateOfBirth=> Faker::Date.backward(10000).strftime("%d-%m-%Y"), :Email=> Faker::Internet.email, # :Password=> Faker::Internet.password, :Client_Type=>"Lender", :dateFormat=>"DD-MM-YYYY", :locale=>"en_GB" } @@musoni_client_datatable ||= Musoni::Datatable.create(:ml_client_details,client.id,datatable_attributes) end |
#create_firstaccess_datatable ⇒ Object
158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
# File 'lib/musoni_ruby/support/test_helper.rb', line 158 def create_firstaccess_datatable client = create_musoni_client datatable_attributes = { :Status=>"Approved", :Risk_Bucket=>"Very Low", :Loan_Size=>"10000", :Interest_Rate=>"10.05", :dateFormat=>"dd-MM-yyyy", :locale=>"en_GB", :submittedon_date=>"27-05-2015", :submittedon_userid=>1 } @@musoni_firstaccess_datatable ||= Musoni::Datatable.create(:cct_First_Access_Score,client.id,datatable_attributes) end |
#create_musoni_client ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/musoni_ruby/support/test_helper.rb', line 2 def create_musoni_client client_attributes = {:officeId=>"2", :firstname=> Faker::Name.first_name, :staffId=>"1", :lastname=> Faker::Name.last_name, :middlename=> Faker::Name.first_name, :externalId=>rand(100000), :mobileNo=>"07234#{rand(10000)}", :submittedOnDate=>"11-05-2015", :active=>"true", :activationDate=> Time.now.strftime("%d-%m-%Y") } @@musoni_client ||= Musoni::Client.create(client_attributes) end |
#create_musoni_loan ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/musoni_ruby/support/test_helper.rb', line 17 def create_musoni_loan = { :submittedOnDate=>"13-05-2015", :clientId=>"3", :productId=>"1", :loanOfficerId=>"1", :loanPurposeId=>"37", :principal=>"10,000.00", :loanTermFrequency=>"1", :loanTermFrequencyType=>"2", :numberOfRepayments=>"1", :repaymentEvery=>"1", :repaymentFrequencyType=>"2", :transactionProcessingStrategyId=>"1", :interestRatePerPeriod=>"5", :expectedDisbursementDate=>"13-05-2015", :amortizationType=>"1", :interestType=>"1", :interestCalculationPeriodType=>"1", :inArrearsTolerance=>"0", :interestChargedFromDate=>"13-05-2015", :repaymentsStartingFromDate=>"13-06-2015", :charges=>[], :loanType=>"individual", :linkAccountId=>"", :graceOnPrincipalPayment=>"0", :graceOnInterestCharged=>"0", :graceOnInterestPayment=>"0", :fundId=>"1", :createStandingInstructionAtDisbursement=>false } @@musoni_loan ||= Musoni::Loan.create() end |
#create_musoni_savings_account ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/musoni_ruby/support/test_helper.rb', line 51 def create_musoni_savings_account = { :clientId=>"1", :productId=>"1", :submittedOnDate=>"13-05-2015", :fieldOfficerId=>"1", :charges=>[], :allowOverdraft=>false } @@musoni_savings_account ||= Musoni::SavingsAccount.create() end |
#create_transunion_datatable ⇒ Object
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
# File 'lib/musoni_ruby/support/test_helper.rb', line 139 def create_transunion_datatable client = create_musoni_client datatable_attributes = { :Credit_History=>"24", :NPA_Accounts=>"1", :NPA_Closed_Accounts=>"1", :NPA_Open_Accounts=>"0", :PA_Accounts=>"11", :PA_Closed_Accounts=>"10", :PA_Open_Accounts=>"1", :Response_Statuscode=>"300", :dateFormat=>"dd-MM-yyyy", :locale=>"en_GB", :submittedon_date=>"27-05-2015", :submittedon_userid=>1 } @@musoni_transunion_datatable ||= Musoni::Datatable.create(:cct_TransUnion,client.id,datatable_attributes) end |