X-Git-Url: https://nos-oignons.net/gitweb/gestion-adh.git/blobdiff_plain/b4230b06ef1709d83f7be84e023b831b7771a940..58822f182891ed954c0f600a70add6a741999d08:/features/step_definitions/subscriptions.rb diff --git a/features/step_definitions/subscriptions.rb b/features/step_definitions/subscriptions.rb index e8481f6..a4827f5 100644 --- a/features/step_definitions/subscriptions.rb +++ b/features/step_definitions/subscriptions.rb @@ -1,3 +1,28 @@ +#-*- coding: utf-8 -*- + +Given /une base de membres vide$/ do + create_dir 'Membres' +end + +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' => paid_on + } + create_dir 'Membres' + file = subscription_filename_for_id(new_id) + write_file file, render_subscription_file(data) +end + When /^j'ajoute une fiche correcte pour une nouvelle adhésion$/ do @file = subscription_filename_for_id(new_id) write_file @file, render_subscription_file(EXTRA_SUBSCRIPTION)