From a0cdfa366e3688112df52d1865ebac2b631776fe Mon Sep 17 00:00:00 2001 From: Lunar Date: Wed, 6 Sep 2017 13:06:14 +0200 Subject: [PATCH] =?utf8?q?Mise=20=C3=A0=20jour=20des=20d=C3=A9pendences=20?= =?utf8?q?et=20correction=20des=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit On met à jour les dépendences pour que ça fonctionne bien sur une Debian Stretch. Pour les tests, vu qu'on est plus en 2016, il faut forcer la date à laquelle on exécute `create-membership-fee-receipt`. Il y a un petit changement lié également lié à un changement de la syntaxe française de Cucumber. --- Gemfile.lock | 63 ++++++++++--------- .../create-membership-fee-receipt.feature | 2 +- features/step_definitions/commands.rb | 6 ++ features/step_definitions/git.rb | 2 +- nos_oignons.gemspec | 2 +- 5 files changed, 43 insertions(+), 32 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 104eb02..b9bb2ac 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -9,49 +9,51 @@ PATH GEM remote: https://rubygems.org/ specs: - aruba (0.12.0) + aruba (0.14.2) childprocess (~> 0.5.6) contracts (~> 0.9) cucumber (>= 1.3.19) - event-bus (~> 0.2) ffi (~> 1.9.10) rspec-expectations (>= 2.99) thor (~> 0.19) - builder (3.2.2) + builder (3.2.3) childprocess (0.5.9) ffi (~> 1.0, >= 1.0.11) - contracts (0.12.0) - cucumber (2.1.0) + contracts (0.16.0) + cucumber (2.4.0) builder (>= 2.1.2) - cucumber-core (~> 1.3.0) + cucumber-core (~> 1.5.0) + cucumber-wire (~> 0.0.1) diff-lcs (>= 1.1.3) - gherkin3 (~> 3.1.0) + gherkin (~> 4.0) multi_json (>= 1.7.5, < 2.0) multi_test (>= 0.1.2) - cucumber-core (1.3.1) - gherkin3 (~> 3.1.0) - diff-lcs (1.2.5) - event-bus (0.2.3) - ffi (1.9.10) - gherkin3 (3.1.2) - json (1.7.7) - mail (2.6.3) - mime-types (>= 1.16, < 3) - mime-types (2.99) - multi_json (1.11.2) + cucumber-core (1.5.0) + gherkin (~> 4.0) + cucumber-wire (0.0.1) + diff-lcs (1.3) + ffi (1.9.18) + gherkin (4.1.3) + json (2.1.0) + mail (2.6.6) + mime-types (>= 1.16, < 4) + mime-types (3.1) + mime-types-data (~> 3.2015) + mime-types-data (3.2016.0521) + multi_json (1.12.2) multi_test (0.1.2) - pdf-core (0.6.0) - prawn (2.0.2) - pdf-core (~> 0.6.0) - ttfunk (~> 1.4.0) - rspec-expectations (3.4.0) + pdf-core (0.7.0) + prawn (2.2.2) + pdf-core (~> 0.7.0) + ttfunk (~> 1.5) + rspec-expectations (3.6.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.4.0) - rspec-support (3.4.1) + rspec-support (~> 3.6.0) + rspec-support (3.6.0) safe_yaml (1.0.4) - thor (0.19.1) - timecop (0.8.0) - ttfunk (1.4.0) + thor (0.20.0) + timecop (0.9.1) + ttfunk (1.5.1) PLATFORMS ruby @@ -59,6 +61,9 @@ PLATFORMS DEPENDENCIES aruba cucumber - json (~> 1.7.7) + json nos_oignons! timecop + +BUNDLED WITH + 1.13.6 diff --git a/features/create-membership-fee-receipt.feature b/features/create-membership-fee-receipt.feature index b2c17aa..0df8ee0 100644 --- a/features/create-membership-fee-receipt.feature +++ b/features/create-membership-fee-receipt.feature @@ -6,7 +6,7 @@ Fonctionnalité: générer des reçus pour les cotisations des membres Scénario: Création du reçu Soit une base avec Jane, membre 000001, ayant cotisé le 2015-06-03 - Lorsque j'exécute `create-membership-fee-receipt 000001 10,00` + Lorsque j'exécute `create-membership-fee-receipt 000001 10,00` le 2015-09-06 Alors le fichier "receipt-000001-2015-06-03.pdf" doit avoir été créé avec les reçus Et il doit contenir le nom et l'adresse de Jane, la date et le montant de la cotisation diff --git a/features/step_definitions/commands.rb b/features/step_definitions/commands.rb index e0b5ea4..622a44b 100644 --- a/features/step_definitions/commands.rb +++ b/features/step_definitions/commands.rb @@ -51,6 +51,12 @@ When /^j'exécute send\-member\-emails\-to\-advisors$/ do NosOignons.send_member_emails_to_advisors! end +When /^j'exécute `create\-membership\-fee\-receipt ([0-9]+) ([0-9,]+)` le ([0-9]{4})-([0-9]{2})-([0-9]{2})$/ do |member, amount, year, month, day| + Timecop.travel(Date.new(year.to_i, month.to_i, day.to_i)) do + NosOignons.create_membership_fee_receipt!(member, amount) + end +end + When /^j'exécute `(create\-membership\-fee\-receipt.*)`$/ do |cmd| run_simple cmd, :fail_on_error => false end diff --git a/features/step_definitions/git.rb b/features/step_definitions/git.rb index 3ea8a8b..3c0e145 100644 --- a/features/step_definitions/git.rb +++ b/features/step_definitions/git.rb @@ -54,7 +54,7 @@ When /je fais un `commit` du nouveau fichier$/ do run_simple "git commit #{@file} -m 'new file'", false # do not fail on error end -When /^que je pousse la modification$/ do +When /je pousse la modification$/ do run_simple "git add #{@file}" run_simple "git commit #{@file} -m 'new file'" run_simple 'git push origin master', false # do not fail on error diff --git a/nos_oignons.gemspec b/nos_oignons.gemspec index 921bf88..c174de2 100644 --- a/nos_oignons.gemspec +++ b/nos_oignons.gemspec @@ -26,7 +26,7 @@ Gem::Specification.new do |s| s.add_development_dependency 'cucumber' s.add_development_dependency 'aruba' - s.add_development_dependency 'json', '~> 1.7.7' + s.add_development_dependency 'json' s.add_development_dependency 'timecop' s.add_runtime_dependency 'safe_yaml' s.add_runtime_dependency 'mail' -- 2.39.5