X-Git-Url: https://nos-oignons.net/gitweb/gestion-adh.git/blobdiff_plain/635887918e9c4b5c8278e4a45958420175a4024a..65790969dc54dfb6eb8d4ad2e03a01dbd382c170:/features/support/fixtures.rb?ds=sidebyside diff --git a/features/support/fixtures.rb b/features/support/fixtures.rb index d3e3353..0fa06c0 100644 --- a/features/support/fixtures.rb +++ b/features/support/fixtures.rb @@ -7,7 +7,7 @@ require 'yaml' BASE_SUBSCRIPTIONS = YAML.load(< -address: - <%= address %> +address: | +<%= address.gsub(/^/, ' ').rstrip %> email: <%= email %> -mumbership_fee_paid_on: <%= membership_fee_paid_on %> +membership_fee_paid_on: <%= membership_fee_paid_on %> --- <%= notes %> @@ -67,3 +68,9 @@ end def render_subscription_file(locals) ERB.new(SUBSCRIPTION_FILE_TEMPLATE).result(OpenStruct.new(locals).instance_eval { binding }) end + +def new_id + max_id = Dir.glob("#{current_dir}/Membres/*.mdwn"). + collect { |f| File.basename(f).gsub(/\.mdwn$/, '').to_i }.max || 0 + max_id + 1 +end