X-Git-Url: https://nos-oignons.net/gitweb/gestion-adh.git/blobdiff_plain/c2e8982b068dc4f47015679ea383a424c4defef1..4a99ae87e0f7fdd07d8820a724fbed1d8b2b5f36:/features/step_definitions/subscriptions.rb diff --git a/features/step_definitions/subscriptions.rb b/features/step_definitions/subscriptions.rb index 62306e9..a4827f5 100644 --- a/features/step_definitions/subscriptions.rb +++ b/features/step_definitions/subscriptions.rb @@ -1,14 +1,22 @@ +#-*- coding: utf-8 -*- + Given /une base de membres vide$/ do create_dir 'Membres' end -Given /^une base avec (\w+), à jour de cotisation$/ do |name| +Given /^(?:une base )?avec (\w+)(, à jour de cotisation| qui n'a pas payé sa cotisation cette année)$/ do |name, uptodate| + case uptodate + when ', à jour de cotisation' + # ± 1 month ago + paid_on = (Time.now - 3600*24*30).strftime('%Y-%m-%d') + else + # ± 15 months ago + paid_on = (Time.now - 3600*24*30*15).strftime('%Y-%m-%d') + end data = { 'name' => name, 'address' => "At #{name}", 'email' => "#{name.downcase}@example.org", - 'membership_fee_paid_on' => - # one month ago - (Time.now - 3600*24*30).strftime('%Y-%m-%d') + 'membership_fee_paid_on' => paid_on } create_dir 'Membres' file = subscription_filename_for_id(new_id)