X-Git-Url: https://nos-oignons.net/gitweb/gestion-adh.git/blobdiff_plain/635887918e9c4b5c8278e4a45958420175a4024a..e4000b47cf37576b44d21dc088601d619a6e5261:/features/step_definitions/subscriptions.rb?ds=sidebyside diff --git a/features/step_definitions/subscriptions.rb b/features/step_definitions/subscriptions.rb index 4fab6a3..50f3dbb 100644 --- a/features/step_definitions/subscriptions.rb +++ b/features/step_definitions/subscriptions.rb @@ -1,6 +1,25 @@ When /^j'ajoute une fiche correcte pour une nouvelle adhésion$/ do - new_id = Dir.glob("#{current_dir}/Membres/*.mdwn"). - collect { |f| File.basename(f).gsub(/\.mdwn$/, '').to_i }.max + 1 @file = subscription_filename_for_id(new_id) write_file @file, render_subscription_file(EXTRA_SUBSCRIPTION) end + +When /^j'ajoute une fiche vide$/ do + @file = subscription_filename_for_id(new_id) + write_file @file, '' +end + +When /^j'ajoute une fiche sans YAML$/ do + @file = subscription_filename_for_id(new_id) + write_file @file, <<-EOF.gsub(/^ /, '') + Ceci est une fiche sans YAML. + EOF +end + +When /^j'ajoute une fiche avec du mauvais YAML$/ do + @file = subscription_filename_for_id(new_id) + write_file @file, <<-EOF.gsub(/^ /, '') + --- + [This is missing a closing bracket + --- + EOF +end