+
+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
+
+When /^j'ajoute une fiche sans email$/ do
+ @file = subscription_filename_for_id(new_id)
+ write_file @file, <<-EOF.gsub(/^ /, '')
+ ---
+ name: J. Example
+ address: |
+ 21 Jump Street
+ 42000 Synthé
+ membership_fee_paid_on: 2013-02-20
+ ---
+ EOF
+end
+
+When /^j'ajoute une fiche sans nom$/ do
+ @file = subscription_filename_for_id(new_id)
+ write_file @file, <<-EOF.gsub(/^ /, '')
+ ---
+ email: joe@example.org
+ address: |
+ 21 Jump Street
+ 42000 Synthé
+ membership_fee_paid_on: 2013-02-20
+ ---
+ EOF
+end
+
+When /^j'ajoute une fiche avec comme date de cotisation "([^"]*)"$/ do |date|
+ @file = subscription_filename_for_id(new_id)
+ write_file @file, <<-EOF.gsub(/^ /, '')
+ ---
+ name: J. Example
+ email: joe@example.org
+ address: |
+ 21 Jump Street
+ 42000 Synthé
+ membership_fee_paid_on: #{date}
+ ---
+ EOF
+end
+
+When /^je supprime le nom sur une fiche existante$/ do
+ @file = subscription_filename_for_id(1)
+ run_simple "sed -e '/^name:/d' -i #{@file}"
+end
+
+When /^j'ajoute un fichier hors de la base des adhérents$/ do
+ @file = 'test'
+ write_file @file, 'Test content.'
+end