From d2f7c655d7363939acbcc558dbe79ef594d37588 Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Sat, 20 Jan 2018 15:19:43 +0100 Subject: [PATCH 01/23] Bump development gems - brakeman - web-console - xray-rails - haml-lint - scss_lint --- .circleci/config.yml | 2 +- .haml-lint.yml | 9 +++++ Gemfile.lock | 39 +++++++++++-------- README.md | 2 +- app/views/dossiers/_infos_dossier.html.haml | 2 +- .../dossiers/_champs.html.haml | 2 +- 6 files changed, 35 insertions(+), 21 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ccd163b61..74fcb9fd5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -68,7 +68,7 @@ jobs: command: bundle exec rubocop - run: name: Run brakeman - command: bundle exec brakeman -z + command: bundle exec brakeman - run: name: Run haml-lint command: bundle exec haml-lint app/views/ diff --git a/.haml-lint.yml b/.haml-lint.yml index 0927e9027..e3d566f90 100644 --- a/.haml-lint.yml +++ b/.haml-lint.yml @@ -43,6 +43,10 @@ linters: character: space # or tab width: 2 # ignored if character == tab + # TODO: enable once we got rid of the legacy UIs + InlineStyles: + enabled: false + InstanceVariables: enabled: false file_types: partials @@ -117,3 +121,8 @@ linters: # locally from time to time UnnecessaryStringOutput: enabled: false + + # Disabled because too agress ive, but to enable + # locally from time to time + ViewLength: + enabled: false diff --git a/Gemfile.lock b/Gemfile.lock index df20eaa38..3f3f2bc11 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -92,6 +92,7 @@ GEM rubyzip (~> 1.0.0) bcrypt (3.1.11) bindata (2.3.4) + bindex (0.5.0) bootstrap-datepicker-rails (1.6.4.1) railties (>= 3.0) bootstrap-sass (3.3.7) @@ -102,7 +103,7 @@ GEM bourbon (4.3.4) sass (~> 3.4) thor (~> 0.19) - brakeman (3.7.0) + brakeman (4.1.1) browser (2.3.0) builder (3.2.3) byebug (9.0.6) @@ -146,7 +147,6 @@ GEM database_cleaner (1.5.3) datetime_picker_rails (0.0.7) momentjs-rails (>= 2.8.1) - debug_inspector (0.0.2) deep_cloneable (2.2.2) activerecord (>= 3.1.0, < 5.2.0) delayed_cron_job (0.7.2) @@ -321,8 +321,8 @@ GEM font-awesome-rails (4.7.0.1) railties (>= 3.2, < 5.1) formatador (0.2.5) - globalid (0.3.7) - activesupport (>= 4.1.0) + globalid (0.4.1) + activesupport (>= 4.2.0) guard (2.14.0) formatador (>= 0.2.4) listen (>= 2.7, < 4.0) @@ -352,11 +352,11 @@ GEM haml (>= 4.0.6, < 5.0) html2haml (>= 1.0.1) railties (>= 4.0.1) - haml_lint (0.24.0) + haml_lint (0.27.0) haml (>= 4.0, < 5.1) rainbow rake (>= 10, < 13) - rubocop (>= 0.47.0) + rubocop (>= 0.50.0) sysexits (~> 1.1) hashdiff (0.3.1) hashie (3.4.6) @@ -413,8 +413,8 @@ GEM crass (~> 1.0.2) nokogiri (>= 1.5.9) lumberjack (1.0.10) - mail (2.6.4) - mime-types (>= 1.16, < 4) + mail (2.7.0) + mini_mime (>= 0.1.1) mailjet (1.4.10) activesupport (>= 3.1.0) rack (>= 1.4.0) @@ -425,6 +425,7 @@ GEM mime-types-data (~> 3.2015) mime-types-data (3.2016.0521) mimemagic (0.3.2) + mini_mime (1.0.0) mini_portile2 (2.3.0) minitest (5.11.1) momentjs-rails (2.17.1) @@ -604,7 +605,11 @@ GEM rubyzip (1.0.0) safe_yaml (1.0.4) sanitize-url (0.1.4) - sass (3.4.22) + sass (3.5.5) + sass-listen (~> 4.0.0) + sass-listen (4.0.0) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) sass-rails (5.0.6) railties (>= 4.0.0, < 6) sass (~> 3.1) @@ -614,9 +619,9 @@ GEM scenic (1.3.0) activerecord (>= 4.0.0) railties (>= 4.0.0) - scss_lint (0.53.0) + scss_lint (0.56.0) rake (>= 0.9, < 13) - sass (~> 3.4.20) + sass (~> 3.5.3) sdoc (0.4.2) json (~> 1.7, >= 1.7.7) rdoc (~> 4.0) @@ -656,10 +661,10 @@ GEM activesupport (>= 4.2) spring-commands-rspec (1.0.4) spring (>= 0.9.1) - sprockets (3.7.0) + sprockets (3.7.1) concurrent-ruby (~> 1.0) rack (> 1, < 3) - sprockets-rails (3.2.0) + sprockets-rails (3.2.1) actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) @@ -702,10 +707,10 @@ GEM activemodel (>= 3.0.0) addressable vcr (3.0.3) - web-console (3.4.0) + web-console (3.5.1) actionview (>= 5.0) activemodel (>= 5.0) - debug_inspector + bindex (>= 0.4.0) railties (>= 5.0) webfinger (1.0.2) activesupport @@ -717,11 +722,11 @@ GEM hashdiff websocket-driver (0.6.5) websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.2) + websocket-extensions (0.1.3) xml-simple (1.1.5) xpath (2.1.0) nokogiri (~> 1.3) - xray-rails (0.2.0) + xray-rails (0.3.1) rails (>= 3.1.0) PLATFORMS diff --git a/README.md b/README.md index 1e50be21a..72098fa29 100644 --- a/README.md +++ b/README.md @@ -120,7 +120,7 @@ Pour exécuter les tests de l'application, plusieurs possibilités : ## Linting - Faire tourner RuboCop : `bundle exec rubocop` -- Faire tourner Brakeman : `bundle exec brakeman -z` +- Faire tourner Brakeman : `bundle exec brakeman` - Linter les fichiers HAML : `bundle exec haml-lint app/views/` - Linter les fichiers SCSS : `bundle exec scss-lint app/assets/stylesheets/` diff --git a/app/views/dossiers/_infos_dossier.html.haml b/app/views/dossiers/_infos_dossier.html.haml index 73ec2bb2b..f1c09ddf9 100644 --- a/app/views/dossiers/_infos_dossier.html.haml +++ b/app/views/dossiers/_infos_dossier.html.haml @@ -43,7 +43,7 @@ - if dossier = link_to("Dossier #{dossier.id}", dossier.decorate.url(gestionnaire_signed_in?), target: '_blank') %br - = dossier.text_summary + = sanitize(dossier.text_summary) - else Pas de dossier associé - else diff --git a/app/views/new_gestionnaire/dossiers/_champs.html.haml b/app/views/new_gestionnaire/dossiers/_champs.html.haml index 1354f4624..45609eaa2 100644 --- a/app/views/new_gestionnaire/dossiers/_champs.html.haml +++ b/app/views/new_gestionnaire/dossiers/_champs.html.haml @@ -27,7 +27,7 @@ - else Dossier nº #{dossier.id} %br - = dossier.text_summary + = sanitize(dossier.text_summary) - else Pas de dossier associé - else From 7873a69d976593b27e840030a37450817b0ce5b7 Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Sat, 20 Jan 2018 15:24:43 +0100 Subject: [PATCH 02/23] Bump test gems - timecop - vcr - webmock - database_cleaner - factory_girl - guard - shoulda-matchers --- Gemfile.lock | 44 +++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3f3f2bc11..1e5e1c86a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -65,8 +65,8 @@ GEM i18n (~> 0.7) minitest (~> 5.1) tzinfo (~> 1.1) - addressable (2.5.1) - public_suffix (~> 2.0, >= 2.0.2) + addressable (2.5.2) + public_suffix (>= 2.0.2, < 4.0) administrate (0.4.0) autoprefixer-rails (~> 6.0) bourbon (~> 4.2) @@ -129,7 +129,7 @@ GEM ffi (~> 1.0, >= 1.0.11) chunky_png (1.3.8) clamav-client (3.1.0) - coderay (1.1.1) + coderay (1.1.2) coffee-rails (4.2.1) coffee-script (>= 2.2.0) railties (>= 4.0.0, < 5.2.x) @@ -144,7 +144,7 @@ GEM safe_yaml (~> 1.0.0) crass (1.0.3) daemons (1.2.4) - database_cleaner (1.5.3) + database_cleaner (1.6.2) datetime_picker_rails (0.0.7) momentjs-rails (>= 2.8.1) deep_cloneable (2.2.2) @@ -186,11 +186,11 @@ GEM eventmachine (1.2.1) excon (0.60.0) execjs (2.7.0) - factory_girl (4.7.0) + factory_girl (4.9.0) activesupport (>= 3.0.0) faraday (0.10.0) multipart-post (>= 1.2, < 3) - ffi (1.9.14) + ffi (1.9.18) fission (0.5.0) CFPropertyList (~> 2.2) fog (1.38.0) @@ -323,10 +323,10 @@ GEM formatador (0.2.5) globalid (0.4.1) activesupport (>= 4.2.0) - guard (2.14.0) + guard (2.14.2) formatador (>= 0.2.4) listen (>= 2.7, < 4.0) - lumberjack (~> 1.0) + lumberjack (>= 1.0.12, < 2.0) nenv (~> 0.1) notiffany (~> 0.0) pry (>= 0.9.12) @@ -358,7 +358,7 @@ GEM rake (>= 10, < 13) rubocop (>= 0.50.0) sysexits (~> 1.1) - hashdiff (0.3.1) + hashdiff (0.3.7) hashie (3.4.6) html2haml (2.2.0) erubis (~> 2.7.0) @@ -412,7 +412,7 @@ GEM loofah (2.1.1) crass (~> 1.0.2) nokogiri (>= 1.5.9) - lumberjack (1.0.10) + lumberjack (1.0.12) mail (2.7.0) mini_mime (>= 0.1.1) mailjet (1.4.10) @@ -420,7 +420,7 @@ GEM rack (>= 1.4.0) rest-client maruku (0.7.2) - method_source (0.8.2) + method_source (0.9.0) mime-types (3.1) mime-types-data (~> 3.2015) mime-types-data (3.2016.0521) @@ -488,14 +488,13 @@ GEM prawn_rails (0.0.11) prawn (>= 0.11.1) railties (>= 3.0.0) - pry (0.10.4) + pry (0.11.3) coderay (~> 1.1.0) - method_source (~> 0.8.1) - slop (~> 3.4) + method_source (~> 0.9.0) pry-byebug (3.4.2) byebug (~> 9.0) pry (~> 0.10) - public_suffix (2.0.5) + public_suffix (3.0.1) rack (2.0.3) rack-handlers (0.7.3) rack @@ -541,9 +540,9 @@ GEM rainbow (3.0.0) raindrops (0.17.0) rake (12.3.0) - rb-fsevent (0.9.8) - rb-inotify (0.9.7) - ffi (>= 0.5.0) + rb-fsevent (0.10.2) + rb-inotify (0.9.10) + ffi (>= 0.5.0, < 2) rbvmomi (1.11.6) builder (~> 3.0) json (>= 1.8) @@ -636,7 +635,7 @@ GEM faraday (>= 0.7.6, < 1.0) sexp_processor (4.10.0) shellany (0.0.1) - shoulda-matchers (3.1.1) + shoulda-matchers (3.1.2) activesupport (>= 4.0.0) simple_form (3.4.0) actionpack (> 4, < 5.1) @@ -648,7 +647,6 @@ GEM tilt (~> 2.0) skylight (1.4.4) activesupport (>= 3.0.0) - slop (3.6.0) smart_listing (1.2.0) coffee-rails jquery-rails @@ -681,7 +679,7 @@ GEM thor (0.20.0) thread_safe (0.3.6) tilt (2.0.8) - timecop (0.8.1) + timecop (0.9.1) trollop (2.1.2) ttfunk (1.4.0) turbolinks (5.0.1) @@ -706,7 +704,7 @@ GEM validate_url (1.0.2) activemodel (>= 3.0.0) addressable - vcr (3.0.3) + vcr (4.0.0) web-console (3.5.1) actionview (>= 5.0) activemodel (>= 5.0) @@ -716,7 +714,7 @@ GEM activesupport httpclient (>= 2.4) multi_json - webmock (2.3.1) + webmock (3.3.0) addressable (>= 2.3.6) crack (>= 0.3.2) hashdiff From d9d88aca895af66a97f9b99a8d2191686ef16623 Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Sat, 20 Jan 2018 15:43:35 +0100 Subject: [PATCH 03/23] Bump development/test gems - byebug - dotenv-rails - pry-byebug - rspec-rails (dependencies) - spring --- Gemfile.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 1e5e1c86a..912c3bf52 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -106,7 +106,7 @@ GEM brakeman (4.1.1) browser (2.3.0) builder (3.2.3) - byebug (9.0.6) + byebug (9.1.0) capybara (2.13.0) addressable mime-types (>= 1.16) @@ -166,13 +166,13 @@ GEM railties (>= 4.1.0, < 5.2) responders warden (~> 1.2.3) - diff-lcs (1.2.5) + diff-lcs (1.3) domain_name (0.5.20170404) unf (>= 0.0.5, < 1.0.0) - dotenv (2.2.0) - dotenv-rails (2.2.0) - dotenv (= 2.2.0) - railties (>= 3.2, < 5.1) + dotenv (2.2.1) + dotenv-rails (2.2.1) + dotenv (= 2.2.1) + railties (>= 3.2, < 5.2) draper (3.0.0.pre1) actionpack (~> 5.0) activemodel (~> 5.0) @@ -491,8 +491,8 @@ GEM pry (0.11.3) coderay (~> 1.1.0) method_source (~> 0.9.0) - pry-byebug (3.4.2) - byebug (~> 9.0) + pry-byebug (3.5.1) + byebug (~> 9.1) pry (~> 0.10) public_suffix (3.0.1) rack (2.0.3) @@ -655,7 +655,7 @@ GEM spreadsheet_architect (1.4.8) axlsx (>= 2.0) rodf (= 0.3.7) - spring (2.0.1) + spring (2.0.2) activesupport (>= 4.2) spring-commands-rspec (1.0.4) spring (>= 0.9.1) From 1c78d77c30a1136d72d191f18914bd34d50458ea Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Sat, 20 Jan 2018 16:44:45 +0100 Subject: [PATCH 04/23] Bump default gems - haml-rails - jquery-rails - unicorn - openid_connect - omniauth-github (dependencies) - fog - mailjet - smart_listing - spreadsheet_architect - apipie-rails - maruku - openstack - browser - skylight - simple_form - scenic - daemons - sentry-raven - administrate (dependencies) - logstasher - chartkick - font-awesome-rails --- Gemfile.lock | 150 ++++++++++-------- .../dossiers/_identite_entreprise.html.haml | 2 +- .../editable_champs/_dossier_link.html.haml | 2 +- 3 files changed, 88 insertions(+), 66 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 912c3bf52..79c3b2fb9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -18,7 +18,7 @@ GIT GEM remote: https://rubygems.org/ specs: - CFPropertyList (2.3.4) + CFPropertyList (2.3.6) actioncable (5.0.0.1) actionpack (= 5.0.0.1) nio4r (~> 1.2) @@ -79,19 +79,22 @@ GEM rails (>= 4.2, < 5.1) sass-rails (~> 5.0) selectize-rails (~> 0.6) - apipie-rails (0.3.7) - json + apipie-rails (0.5.6) + rails (>= 4.1) arel (7.1.4) ast (2.3.0) attr_required (1.0.1) - autoprefixer-rails (6.5.4) + autoprefixer-rails (6.7.7.2) execjs axlsx (2.0.1) htmlentities (~> 4.3.1) nokogiri (>= 1.4.1) rubyzip (~> 1.0.0) + axlsx_styler (0.1.7) + activesupport (>= 3.1) + axlsx (~> 2.0) bcrypt (3.1.11) - bindata (2.3.4) + bindata (2.4.1) bindex (0.5.0) bootstrap-datepicker-rails (1.6.4.1) railties (>= 3.0) @@ -104,7 +107,7 @@ GEM sass (~> 3.4) thor (~> 0.19) brakeman (4.1.1) - browser (2.3.0) + browser (2.5.2) builder (3.2.3) byebug (9.1.0) capybara (2.13.0) @@ -124,15 +127,15 @@ GEM mime-types (>= 1.16) mimemagic (>= 0.3.0) carrierwave-i18n (0.2.0) - chartkick (2.2.1) + chartkick (2.2.5) childprocess (0.8.0) ffi (~> 1.0, >= 1.0.11) chunky_png (1.3.8) clamav-client (3.1.0) coderay (1.1.2) - coffee-rails (4.2.1) + coffee-rails (4.2.2) coffee-script (>= 2.2.0) - railties (>= 4.0.0, < 5.2.x) + railties (>= 4.0.0) coffee-script (2.4.1) coffee-script-source execjs @@ -143,7 +146,7 @@ GEM crack (0.4.3) safe_yaml (~> 1.0.0) crass (1.0.3) - daemons (1.2.4) + daemons (1.2.6) database_cleaner (1.6.2) datetime_picker_rails (0.0.7) momentjs-rails (>= 2.8.1) @@ -188,21 +191,25 @@ GEM execjs (2.7.0) factory_girl (4.9.0) activesupport (>= 3.0.0) - faraday (0.10.0) + faraday (0.12.2) multipart-post (>= 1.2, < 3) ffi (1.9.18) fission (0.5.0) CFPropertyList (~> 2.2) - fog (1.38.0) + fog (1.41.0) fog-aliyun (>= 0.1.0) fog-atmos fog-aws (>= 0.6.0) fog-brightbox (~> 0.4) fog-cloudatcost (~> 0.1.0) - fog-core (~> 1.32) + fog-core (~> 1.45) + fog-digitalocean (>= 0.3.0) + fog-dnsimple (~> 1.0) fog-dynect (~> 0.0.2) fog-ecloud (~> 0.1) fog-google (<= 0.1.0) + fog-internet-archive + fog-joyent fog-json fog-local fog-openstack @@ -222,7 +229,8 @@ GEM fog-xenserver fog-xml (~> 0.1.1) ipaddress (~> 0.5) - fog-aliyun (0.1.0) + json (>= 1.8, < 2.0) + fog-aliyun (0.2.0) fog-core (~> 1.27) fog-json (~> 1.0) ipaddress (~> 0.8) @@ -230,12 +238,12 @@ GEM fog-atmos (0.1.0) fog-core fog-xml - fog-aws (1.0.0) + fog-aws (2.0.0) fog-core (~> 1.38) fog-json (~> 1.0) fog-xml (~> 0.1) ipaddress (~> 0.8) - fog-brightbox (0.11.0) + fog-brightbox (0.14.0) fog-core (~> 1.22) fog-json inflecto (~> 0.0.2) @@ -248,6 +256,14 @@ GEM builder excon (~> 0.58) formatador (~> 0.2) + fog-digitalocean (0.3.0) + fog-core (~> 1.42) + fog-json (>= 1.0) + fog-xml (>= 0.1) + ipaddress (>= 0.5) + fog-dnsimple (1.0.0) + fog-core (~> 1.38) + fog-json (~> 1.0) fog-dynect (0.0.3) fog-core fog-json @@ -259,23 +275,30 @@ GEM fog-core fog-json fog-xml + fog-internet-archive (0.0.1) + fog-core + fog-json + fog-xml + fog-joyent (0.0.1) + fog-core (~> 1.42) + fog-json (>= 1.0) fog-json (1.0.2) fog-core (~> 1.0) multi_json (~> 1.10) - fog-local (0.3.1) + fog-local (0.4.0) fog-core (~> 1.27) - fog-openstack (0.1.18) - fog-core (>= 1.40) + fog-openstack (0.1.23) + fog-core (~> 1.40) fog-json (>= 1.0) ipaddress (>= 0.8) fog-powerdns (0.1.1) fog-core (~> 1.27) fog-json (~> 1.0) fog-xml (~> 0.1) - fog-profitbricks (3.0.0) + fog-profitbricks (4.1.1) fog-core (~> 1.42) fog-json (~> 1.0) - fog-rackspace (0.1.2) + fog-rackspace (0.1.5) fog-core (>= 1.35) fog-json (>= 1.0) fog-xml (>= 0.1) @@ -309,17 +332,17 @@ GEM fog-voxel (0.1.0) fog-core fog-xml - fog-vsphere (1.5.2) + fog-vsphere (1.13.1) fog-core rbvmomi (~> 1.9) - fog-xenserver (0.2.3) + fog-xenserver (0.3.0) fog-core fog-xml fog-xml (0.1.3) fog-core nokogiri (>= 1.5.11, < 2.0.0) - font-awesome-rails (4.7.0.1) - railties (>= 3.2, < 5.1) + font-awesome-rails (4.7.0.3) + railties (>= 3.2, < 5.2) formatador (0.2.5) globalid (0.4.1) activesupport (>= 4.2.0) @@ -342,14 +365,15 @@ GEM guard (~> 2.1) guard-compat (~> 1.1) rspec (>= 2.99.0, < 4.0) - haml (4.0.7) + haml (5.0.4) + temple (>= 0.8.0) tilt haml-lint (0.999.999) haml_lint - haml-rails (0.9.0) + haml-rails (1.0.0) actionpack (>= 4.0.1) activesupport (>= 4.0.1) - haml (>= 4.0.6, < 5.0) + haml (>= 4.0.6, < 6.0) html2haml (>= 1.0.1) railties (>= 4.0.1) haml_lint (0.27.0) @@ -359,7 +383,7 @@ GEM rubocop (>= 0.50.0) sysexits (~> 1.1) hashdiff (0.3.7) - hashie (3.4.6) + hashie (3.5.7) html2haml (2.2.0) erubis (~> 2.7.0) haml (>= 4.0, < 6) @@ -374,15 +398,14 @@ GEM concurrent-ruby (~> 1.0) inflecto (0.0.2) ipaddress (0.8.3) - jquery-rails (4.2.1) + jquery-rails (4.3.1) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) json (1.8.6) - json-jwt (1.7.0) + json-jwt (1.8.3) activesupport bindata - multi_json (>= 1.3) securecompare url_safe_base64 jsonapi (0.1.1.beta2) @@ -391,7 +414,7 @@ GEM kaminari (0.17.0) actionpack (>= 3.0.0) activesupport (>= 3.0.0) - kgio (2.10.0) + kgio (2.11.1) launchy (2.4.3) addressable (~> 2.3) leaflet-draw-rails (0.1.0) @@ -404,8 +427,7 @@ GEM rb-inotify (~> 0.9, >= 0.9.7) ruby_dep (~> 1.2) logstash-event (1.2.02) - logstasher (1.1.0) - activerecord (>= 4.0) + logstasher (1.2.2) activesupport (>= 4.0) logstash-event (~> 1.2.0) request_store @@ -415,11 +437,11 @@ GEM lumberjack (1.0.12) mail (2.7.0) mini_mime (>= 0.1.1) - mailjet (1.4.10) + mailjet (1.5.4) activesupport (>= 3.1.0) rack (>= 1.4.0) rest-client - maruku (0.7.2) + maruku (0.7.3) method_source (0.9.0) mime-types (3.1) mime-types-data (~> 3.2015) @@ -430,7 +452,7 @@ GEM minitest (5.11.1) momentjs-rails (2.17.1) railties (>= 3.1) - multi_json (1.12.1) + multi_json (1.13.1) multi_xml (0.6.0) multipart-post (2.0.0) mustermann (1.0.1) @@ -452,7 +474,7 @@ GEM multi_json (~> 1.3) multi_xml (~> 0.5) rack (>= 1.2, < 3) - omniauth (1.7.1) + omniauth (1.8.1) hashie (>= 3.4.6, < 3.6.0) rack (>= 1.6.2, < 3) omniauth-github (1.3.0) @@ -462,18 +484,18 @@ GEM oauth2 (~> 1.1) omniauth (~> 1.2) open4 (1.3.4) - openid_connect (0.12.0) + openid_connect (1.1.3) activemodel attr_required (>= 1.0.0) json (>= 1.4.3) json-jwt (>= 1.5.0) - rack-oauth2 (>= 1.3.1) + rack-oauth2 (>= 1.6.1) swd (>= 1.0.0) tzinfo validate_email validate_url webfinger (>= 1.0.1) - openstack (3.3.7) + openstack (3.3.12) json orm_adapter (0.5.0) parallel (1.12.1) @@ -500,7 +522,7 @@ GEM rack rack-mini-profiler (0.10.7) rack (>= 1.2.0) - rack-oauth2 (1.4.0) + rack-oauth2 (1.7.0) activesupport (>= 2.3) attr_required (>= 0.0.5) httpclient (>= 2.4) @@ -538,7 +560,7 @@ GEM rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) rainbow (3.0.0) - raindrops (0.17.0) + raindrops (0.19.0) rake (12.3.0) rb-fsevent (0.10.2) rb-inotify (0.9.10) @@ -550,7 +572,8 @@ GEM trollop (~> 2.1) rdoc (4.3.0) ref (2.0.0) - request_store (1.3.1) + request_store (1.4.0) + rack (>= 1.4) responders (2.4.0) actionpack (>= 4.2.0, < 5.3) railties (>= 4.2.0, < 5.3) @@ -561,10 +584,10 @@ GEM rgeo (0.5.3) rgeo-geojson (0.4.3) rgeo (~> 0.5) - rodf (0.3.7) - activesupport (>= 3.0, < 6.0) - builder (~> 3.0) - rubyzip (~> 1.0) + rodf (1.0.0) + activesupport (>= 3.0) + builder (>= 3.0) + rubyzip (>= 1.0) rspec (3.5.0) rspec-core (~> 3.5.0) rspec-expectations (~> 3.5.0) @@ -609,13 +632,13 @@ GEM sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) - sass-rails (5.0.6) + sass-rails (5.0.7) railties (>= 4.0.0, < 6) sass (~> 3.1) sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) - scenic (1.3.0) + scenic (1.4.1) activerecord (>= 4.0.0) railties (>= 4.0.0) scss_lint (0.56.0) @@ -631,30 +654,31 @@ GEM selenium-webdriver (3.8.0) childprocess (~> 0.5) rubyzip (~> 1.0) - sentry-raven (2.2.0) + sentry-raven (2.7.1) faraday (>= 0.7.6, < 1.0) sexp_processor (4.10.0) shellany (0.0.1) shoulda-matchers (3.1.2) activesupport (>= 4.0.0) - simple_form (3.4.0) - actionpack (> 4, < 5.1) - activemodel (> 4, < 5.1) + simple_form (3.5.0) + actionpack (> 4, < 5.2) + activemodel (> 4, < 5.2) sinatra (2.0.0) mustermann (~> 1.0) rack (~> 2.0) rack-protection (= 2.0.0) tilt (~> 2.0) - skylight (1.4.4) + skylight (1.5.0) activesupport (>= 3.0.0) smart_listing (1.2.0) coffee-rails jquery-rails kaminari (~> 0.17) rails (>= 3.2) - spreadsheet_architect (1.4.8) + spreadsheet_architect (2.0.2) axlsx (>= 2.0) - rodf (= 0.3.7) + axlsx_styler (>= 0.1.7) + rodf (>= 1.0.0) spring (2.0.2) activesupport (>= 4.2) spring-commands-rspec (1.0.4) @@ -666,13 +690,12 @@ GEM actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) - swd (1.0.1) + swd (1.1.2) activesupport (>= 3) attr_required (>= 0.0.5) httpclient (>= 2.4) - i18n - json (>= 1.4.3) sysexits (1.2.0) + temple (0.8.0) therubyracer (0.12.3) libv8 (~> 3.16.14.15) ref @@ -694,7 +717,7 @@ GEM unf_ext (0.0.7.4) unicode-display_width (1.3.0) unicode_utils (1.4.0) - unicorn (5.2.0) + unicorn (5.4.0) kgio (~> 2.6) raindrops (~> 0.7) url_safe_base64 (0.2.2) @@ -710,10 +733,9 @@ GEM activemodel (>= 5.0) bindex (>= 0.4.0) railties (>= 5.0) - webfinger (1.0.2) + webfinger (1.1.0) activesupport httpclient (>= 2.4) - multi_json webmock (3.3.0) addressable (>= 2.3.6) crack (>= 0.3.2) diff --git a/app/views/new_gestionnaire/dossiers/_identite_entreprise.html.haml b/app/views/new_gestionnaire/dossiers/_identite_entreprise.html.haml index d3669980b..a60448c29 100644 --- a/app/views/new_gestionnaire/dossiers/_identite_entreprise.html.haml +++ b/app/views/new_gestionnaire/dossiers/_identite_entreprise.html.haml @@ -9,7 +9,7 @@ %td= entreprise.siret_siege_social %tr %th Forme juridique : - %td= entreprise.forme_juridique + %td= sanitize(entreprise.forme_juridique) - if etablissement.present? %tr %th Libellé NAF : diff --git a/app/views/new_gestionnaire/dossiers/editable_champs/_dossier_link.html.haml b/app/views/new_gestionnaire/dossiers/editable_champs/_dossier_link.html.haml index 4c6fd69b3..924cdc78e 100644 --- a/app/views/new_gestionnaire/dossiers/editable_champs/_dossier_link.html.haml +++ b/app/views/new_gestionnaire/dossiers/editable_champs/_dossier_link.html.haml @@ -1,7 +1,7 @@ - dossier = Dossier.find_by(id: champ.value) - show_text_summary = dossier.present? - show_warning = !show_text_summary && champ.value.present? -- text_summary = dossier.try(:text_summary) +- text_summary = sanitize(dossier.try(:text_summary)) .dossier-link = form.number_field :value, From 4c87b62565649ae0be04ca167dff16ebe3cf3943 Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Sat, 20 Jan 2018 20:11:33 +0100 Subject: [PATCH 05/23] Bump deep_cloneable --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 591ce5f76..e211027b2 100644 --- a/Gemfile +++ b/Gemfile @@ -18,7 +18,7 @@ gem 'turbolinks', '~> 5.0' gem 'sdoc', '~> 0.4.0', group: :doc # Enable deep clone of active record models -gem 'deep_cloneable', '~> 2.2.1' +gem 'deep_cloneable' gem 'warden', git: 'https://github.com/hassox/warden.git', branch: 'master' diff --git a/Gemfile.lock b/Gemfile.lock index 79c3b2fb9..628b6ea8e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -150,7 +150,7 @@ GEM database_cleaner (1.6.2) datetime_picker_rails (0.0.7) momentjs-rails (>= 2.8.1) - deep_cloneable (2.2.2) + deep_cloneable (2.3.1) activerecord (>= 3.1.0, < 5.2.0) delayed_cron_job (0.7.2) delayed_job (>= 4.1) @@ -772,7 +772,7 @@ DEPENDENCIES copy_carrierwave_file daemons database_cleaner - deep_cloneable (~> 2.2.1) + deep_cloneable delayed_cron_job delayed_job_active_record delayed_job_web From 571612f922cbaa22b3e0662a2f3dad37bda056da Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Sat, 20 Jan 2018 20:13:53 +0100 Subject: [PATCH 06/23] Bump draper --- Gemfile | 2 +- Gemfile.lock | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index e211027b2..d2c0c2d05 100644 --- a/Gemfile +++ b/Gemfile @@ -38,7 +38,7 @@ gem 'bootstrap-sass', '~> 3.3.5' gem 'kaminari' # Decorators -gem 'draper', '~> 3.0.0.pre1' +gem 'draper' gem 'unicode_utils' diff --git a/Gemfile.lock b/Gemfile.lock index 628b6ea8e..085a4f187 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -51,9 +51,8 @@ GEM globalid (>= 0.3.6) activemodel (5.0.0.1) activesupport (= 5.0.0.1) - activemodel-serializers-xml (1.0.1) + activemodel-serializers-xml (1.0.2) activemodel (> 5.x) - activerecord (> 5.x) activesupport (> 5.x) builder (~> 3.1) activerecord (5.0.0.1) @@ -176,7 +175,7 @@ GEM dotenv-rails (2.2.1) dotenv (= 2.2.1) railties (>= 3.2, < 5.2) - draper (3.0.0.pre1) + draper (3.0.1) actionpack (~> 5.0) activemodel (~> 5.0) activemodel-serializers-xml (~> 1.0) @@ -778,7 +777,7 @@ DEPENDENCIES delayed_job_web devise dotenv-rails - draper (~> 3.0.0.pre1) + draper factory_girl fog fog-openstack From 3d20b24baf556d7c912977889d2a4da707199ca4 Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Sat, 20 Jan 2018 20:15:21 +0100 Subject: [PATCH 07/23] Bump prawn --- Gemfile | 2 +- Gemfile.lock | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Gemfile b/Gemfile index d2c0c2d05..4b05ef40e 100644 --- a/Gemfile +++ b/Gemfile @@ -107,7 +107,7 @@ gem "delayed_job_web" gem 'select2-rails' # PDF Generation -gem 'prawn', '~> 2.0.1' +gem 'prawn' gem 'prawn_rails', '~> 0.0.11' gem 'chunky_png' diff --git a/Gemfile.lock b/Gemfile.lock index 085a4f187..f27a9428f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -500,12 +500,12 @@ GEM parallel (1.12.1) parser (2.4.0.2) ast (~> 2.3) - pdf-core (0.6.1) + pdf-core (0.7.0) pg (0.19.0) powerpack (0.1.1) - prawn (2.0.2) - pdf-core (~> 0.6.0) - ttfunk (~> 1.4.0) + prawn (2.2.2) + pdf-core (~> 0.7.0) + ttfunk (~> 1.5) prawn_rails (0.0.11) prawn (>= 0.11.1) railties (>= 3.0.0) @@ -703,7 +703,7 @@ GEM tilt (2.0.8) timecop (0.9.1) trollop (2.1.2) - ttfunk (1.4.0) + ttfunk (1.5.1) turbolinks (5.0.1) turbolinks-source (~> 5) turbolinks-source (5.0.0) @@ -802,7 +802,7 @@ DEPENDENCIES openid_connect openstack pg - prawn (~> 2.0.1) + prawn prawn_rails (~> 0.0.11) pry-byebug rack-handlers From 3f1af527cc8a09e5dacbea364aa401f1228dbc67 Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Sat, 20 Jan 2018 20:17:09 +0100 Subject: [PATCH 08/23] Bump prawn_rails --- Gemfile | 2 +- Gemfile.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 4b05ef40e..417854827 100644 --- a/Gemfile +++ b/Gemfile @@ -108,7 +108,7 @@ gem 'select2-rails' # PDF Generation gem 'prawn' -gem 'prawn_rails', '~> 0.0.11' +gem 'prawn_rails' gem 'chunky_png' gem 'sentry-raven' diff --git a/Gemfile.lock b/Gemfile.lock index f27a9428f..6c1e56c67 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -803,7 +803,7 @@ DEPENDENCIES openstack pg prawn - prawn_rails (~> 0.0.11) + prawn_rails pry-byebug rack-handlers rack-mini-profiler From 9cea28aed85914ee7a7f1d6fdbbce2bdabffeeb4 Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Sat, 20 Jan 2018 20:19:37 +0100 Subject: [PATCH 09/23] Bump default gems - active_model_serializers - rgeo-geojson --- Gemfile.lock | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 6c1e56c67..bd0e0872a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -42,10 +42,11 @@ GEM erubis (~> 2.7.0) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - active_model_serializers (0.10.3) + active_model_serializers (0.10.7) actionpack (>= 4.1, < 6) activemodel (>= 4.1, < 6) - jsonapi (= 0.1.1.beta2) + case_transform (>= 0.2) + jsonapi-renderer (>= 0.1.1.beta1, < 0.3) activejob (5.0.0.1) activesupport (= 5.0.0.1) globalid (>= 0.3.6) @@ -126,6 +127,8 @@ GEM mime-types (>= 1.16) mimemagic (>= 0.3.0) carrierwave-i18n (0.2.0) + case_transform (0.2) + activesupport chartkick (2.2.5) childprocess (0.8.0) ffi (~> 1.0, >= 1.0.11) @@ -407,8 +410,7 @@ GEM bindata securecompare url_safe_base64 - jsonapi (0.1.1.beta2) - json (~> 1.8) + jsonapi-renderer (0.2.0) jwt (1.5.6) kaminari (0.17.0) actionpack (>= 3.0.0) @@ -580,9 +582,9 @@ GEM http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) - rgeo (0.5.3) - rgeo-geojson (0.4.3) - rgeo (~> 0.5) + rgeo (1.0.0) + rgeo-geojson (2.0.0) + rgeo (~> 1.0) rodf (1.0.0) activesupport (>= 3.0) builder (>= 3.0) From 89a39e2964ee91a255ec1367807626d7a47b6982 Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Sat, 20 Jan 2018 20:33:25 +0100 Subject: [PATCH 10/23] Bump rails --- Gemfile | 2 +- Gemfile.lock | 74 ++++++++++++++++++++++++++-------------------------- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/Gemfile b/Gemfile index 417854827..64d899923 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' -gem 'rails', '5.0.0.1' +gem 'rails' # Use SCSS for stylesheets gem 'sass-rails', '~> 5.0' diff --git a/Gemfile.lock b/Gemfile.lock index bd0e0872a..40320c29e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -19,48 +19,48 @@ GEM remote: https://rubygems.org/ specs: CFPropertyList (2.3.6) - actioncable (5.0.0.1) - actionpack (= 5.0.0.1) - nio4r (~> 1.2) + actioncable (5.0.6) + actionpack (= 5.0.6) + nio4r (>= 1.2, < 3.0) websocket-driver (~> 0.6.1) - actionmailer (5.0.0.1) - actionpack (= 5.0.0.1) - actionview (= 5.0.0.1) - activejob (= 5.0.0.1) + actionmailer (5.0.6) + actionpack (= 5.0.6) + actionview (= 5.0.6) + activejob (= 5.0.6) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.0.0.1) - actionview (= 5.0.0.1) - activesupport (= 5.0.0.1) + actionpack (5.0.6) + actionview (= 5.0.6) + activesupport (= 5.0.6) rack (~> 2.0) rack-test (~> 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.0.0.1) - activesupport (= 5.0.0.1) + actionview (5.0.6) + activesupport (= 5.0.6) builder (~> 3.1) erubis (~> 2.7.0) rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.2) + rails-html-sanitizer (~> 1.0, >= 1.0.3) active_model_serializers (0.10.7) actionpack (>= 4.1, < 6) activemodel (>= 4.1, < 6) case_transform (>= 0.2) jsonapi-renderer (>= 0.1.1.beta1, < 0.3) - activejob (5.0.0.1) - activesupport (= 5.0.0.1) + activejob (5.0.6) + activesupport (= 5.0.6) globalid (>= 0.3.6) - activemodel (5.0.0.1) - activesupport (= 5.0.0.1) + activemodel (5.0.6) + activesupport (= 5.0.6) activemodel-serializers-xml (1.0.2) activemodel (> 5.x) activesupport (> 5.x) builder (~> 3.1) - activerecord (5.0.0.1) - activemodel (= 5.0.0.1) - activesupport (= 5.0.0.1) + activerecord (5.0.6) + activemodel (= 5.0.6) + activesupport (= 5.0.6) arel (~> 7.0) - activesupport (5.0.0.1) + activesupport (5.0.6) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (~> 0.7) minitest (~> 5.1) @@ -462,7 +462,7 @@ GEM thor (~> 0.19) nenv (0.3.0) netrc (0.11.0) - nio4r (1.2.1) + nio4r (2.2.0) nokogiri (1.8.1) mini_portile2 (~> 2.3.0) normalize-rails (3.0.3) @@ -533,17 +533,17 @@ GEM rack rack-test (0.6.3) rack (>= 1.0) - rails (5.0.0.1) - actioncable (= 5.0.0.1) - actionmailer (= 5.0.0.1) - actionpack (= 5.0.0.1) - actionview (= 5.0.0.1) - activejob (= 5.0.0.1) - activemodel (= 5.0.0.1) - activerecord (= 5.0.0.1) - activesupport (= 5.0.0.1) - bundler (>= 1.3.0, < 2.0) - railties (= 5.0.0.1) + rails (5.0.6) + actioncable (= 5.0.6) + actionmailer (= 5.0.6) + actionpack (= 5.0.6) + actionview (= 5.0.6) + activejob (= 5.0.6) + activemodel (= 5.0.6) + activerecord (= 5.0.6) + activesupport (= 5.0.6) + bundler (>= 1.3.0) + railties (= 5.0.6) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.1) actionpack (~> 5.x) @@ -554,9 +554,9 @@ GEM nokogiri (>= 1.6) rails-html-sanitizer (1.0.3) loofah (~> 2.0) - railties (5.0.0.1) - actionpack (= 5.0.0.1) - activesupport (= 5.0.0.1) + railties (5.0.6) + actionpack (= 5.0.6) + activesupport (= 5.0.6) method_source rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) @@ -809,7 +809,7 @@ DEPENDENCIES pry-byebug rack-handlers rack-mini-profiler - rails (= 5.0.0.1) + rails rails-controller-testing rest-client rgeo-geojson From 12b6d30326ee3e25cf0c18e53bccd74d09c978ae Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Sat, 20 Jan 2018 20:36:29 +0100 Subject: [PATCH 11/23] Bump sass-rails --- Gemfile | 2 +- Gemfile.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 64d899923..f1f80c818 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,7 @@ source 'https://rubygems.org' gem 'rails' # Use SCSS for stylesheets -gem 'sass-rails', '~> 5.0' +gem 'sass-rails' # Use Uglifier as compressor for JavaScript assets gem 'uglifier', '>= 1.3.0' diff --git a/Gemfile.lock b/Gemfile.lock index 40320c29e..efd26efa7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -818,7 +818,7 @@ DEPENDENCIES rubocop rubocop-rspec-focused sanitize-url - sass-rails (~> 5.0) + sass-rails scenic scss_lint sdoc (~> 0.4.0) From 5340b4ed0d369f0bf85f911bc5f756e5024f702b Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Sat, 20 Jan 2018 20:38:08 +0100 Subject: [PATCH 12/23] Bump turbolinks --- Gemfile | 2 +- Gemfile.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index f1f80c818..a3c955f81 100644 --- a/Gemfile +++ b/Gemfile @@ -13,7 +13,7 @@ gem 'therubyracer', platforms: :ruby # Use jquery as the JavaScript library gem 'jquery-rails' # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks -gem 'turbolinks', '~> 5.0' +gem 'turbolinks' # bundle exec rake doc:rails generates the API under doc/api. gem 'sdoc', '~> 0.4.0', group: :doc diff --git a/Gemfile.lock b/Gemfile.lock index efd26efa7..f234386c5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -706,9 +706,9 @@ GEM timecop (0.9.1) trollop (2.1.2) ttfunk (1.5.1) - turbolinks (5.0.1) - turbolinks-source (~> 5) - turbolinks-source (5.0.0) + turbolinks (5.1.0) + turbolinks-source (~> 5.1) + turbolinks-source (5.1.0) tzinfo (1.2.4) thread_safe (~> 0.1) uglifier (4.1.3) @@ -833,7 +833,7 @@ DEPENDENCIES spring-commands-rspec therubyracer timecop - turbolinks (~> 5.0) + turbolinks uglifier (>= 1.3.0) unicode_utils unicorn From 2761f8ac8676a72b0875a620f767b686aa78fa88 Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Sat, 20 Jan 2018 20:39:53 +0100 Subject: [PATCH 13/23] Bump rspec-rails --- Gemfile | 2 +- Gemfile.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index a3c955f81..dd2d8e625 100644 --- a/Gemfile +++ b/Gemfile @@ -153,7 +153,7 @@ group :development, :test do # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' gem 'spring-commands-rspec' - gem 'rspec-rails', '~> 3.0' + gem 'rspec-rails' # Deploy gem 'mina', ref: '343a7', git: 'https://github.com/mina-deploy/mina.git' diff --git a/Gemfile.lock b/Gemfile.lock index f234386c5..694f7458f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -813,7 +813,7 @@ DEPENDENCIES rails-controller-testing rest-client rgeo-geojson - rspec-rails (~> 3.0) + rspec-rails rspec_junit_formatter rubocop rubocop-rspec-focused From 2bb6613ca872e2e51a4bed459ae6d552292070cb Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Sat, 20 Jan 2018 20:51:16 +0100 Subject: [PATCH 14/23] Bump rails-controller-testing --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 694f7458f..9e684e2e0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -545,9 +545,9 @@ GEM bundler (>= 1.3.0) railties (= 5.0.6) sprockets-rails (>= 2.0.0) - rails-controller-testing (1.0.1) - actionpack (~> 5.x) - actionview (~> 5.x) + rails-controller-testing (1.0.2) + actionpack (~> 5.x, >= 5.0.1) + actionview (~> 5.x, >= 5.0.1) activesupport (~> 5.x) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) From 9aea126db08ef52c3a46a83c1482264f524e2aec Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Sat, 20 Jan 2018 20:57:52 +0100 Subject: [PATCH 15/23] Bump rubocop-rspec-focused --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 9e684e2e0..79be05a5b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -619,8 +619,8 @@ GEM rainbow (>= 2.2.2, < 4.0) ruby-progressbar (~> 1.7) unicode-display_width (~> 1.0, >= 1.0.1) - rubocop-rspec-focused (0.1.0) - rubocop (>= 0.37) + rubocop-rspec-focused (1.0.0) + rubocop (>= 0.51) ruby-progressbar (1.9.0) ruby_dep (1.5.0) ruby_parser (3.10.1) From f5629f83928aff0b35f4b90f4dd571869f207d78 Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Sun, 21 Jan 2018 12:12:14 +0100 Subject: [PATCH 16/23] Bump capybara --- Gemfile.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 79be05a5b..d4d8f6bee 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -110,13 +110,13 @@ GEM browser (2.5.2) builder (3.2.3) byebug (9.1.0) - capybara (2.13.0) + capybara (2.17.0) addressable - mime-types (>= 1.16) + mini_mime (>= 0.1.3) nokogiri (>= 1.3.3) rack (>= 1.0.0) rack-test (>= 0.5.4) - xpath (~> 2.0) + xpath (>= 2.0, < 4.0) capybara-selenium (0.0.6) capybara selenium-webdriver @@ -745,8 +745,8 @@ GEM websocket-extensions (>= 0.1.0) websocket-extensions (0.1.3) xml-simple (1.1.5) - xpath (2.1.0) - nokogiri (~> 1.3) + xpath (3.0.0) + nokogiri (~> 1.8) xray-rails (0.3.1) rails (>= 3.1.0) From 5eb4f12b4821737c9aa9440182efa3ed1efe46d8 Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Tue, 23 Jan 2018 17:14:13 +0100 Subject: [PATCH 17/23] Remove a now deprecated Capybara option from tests --- spec/features/admin/procedure_creation_spec.rb | 8 ++++---- spec/features/users/dossier_creation_spec.rb | 14 +++++++------- spec/features/users/dossier_edition_spec.rb | 8 ++++---- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/spec/features/admin/procedure_creation_spec.rb b/spec/features/admin/procedure_creation_spec.rb index 6b3111560..84a2ce637 100644 --- a/spec/features/admin/procedure_creation_spec.rb +++ b/spec/features/admin/procedure_creation_spec.rb @@ -11,24 +11,24 @@ feature 'As an administrateur I wanna create a new procedure', js: true do context 'Right after sign_in I shall see all procedure states links' do scenario 'Finding draft procedures' do page.find_by_id('draft-procedures').click - expect(page).to have_current_path(admin_procedures_draft_path, only_path: true) + expect(page).to have_current_path(admin_procedures_draft_path) end scenario 'Finding active procedures' do page.find_by_id('active-procedures').click - expect(page).to have_current_path(admin_procedures_path, only_path: true) + expect(page).to have_current_path(admin_procedures_path) end scenario 'Finding archived procedures' do page.find_by_id('archived-procedures').click - expect(page).to have_current_path(admin_procedures_archived_path, only_path: true) + expect(page).to have_current_path(admin_procedures_archived_path) end end context 'Creating a new procedure' do scenario 'Finding new procedure link' do page.find_by_id('new-procedure').click - expect(page).to have_current_path(new_admin_procedure_path, only_path: true) + expect(page).to have_current_path(new_admin_procedure_path) end scenario 'Finding save button for new procedure, libelle and description required' do diff --git a/spec/features/users/dossier_creation_spec.rb b/spec/features/users/dossier_creation_spec.rb index 564f224f5..7543c4c0f 100644 --- a/spec/features/users/dossier_creation_spec.rb +++ b/spec/features/users/dossier_creation_spec.rb @@ -21,30 +21,30 @@ feature 'As a User I wanna create a dossier' do scenario "with a proper date input field for birthdate (type='date' supported)" do fill_in 'dossier_individual_attributes_birthdate', with: '1987-10-14' page.find_by_id('etape_suivante').click - expect(page).to have_current_path(users_dossier_carte_path(procedure_for_individual.dossiers.last.id.to_s), only_path: true) + expect(page).to have_current_path(users_dossier_carte_path(procedure_for_individual.dossiers.last.id.to_s)) page.find_by_id('etape_suivante').click fill_in "champs_#{procedure_for_individual.dossiers.last.champs.first.id}", with: 'contenu du champ 1' page.find_by_id('suivant').click expect(user.dossiers.first.individual.birthdate).to eq("1987-10-14") - expect(page).to have_current_path(users_dossier_recapitulatif_path(procedure_for_individual.dossiers.last.id.to_s), only_path: true) + expect(page).to have_current_path(users_dossier_recapitulatif_path(procedure_for_individual.dossiers.last.id.to_s)) end scenario "with a basic text input field for birthdate (type='date' unsupported)" do fill_in 'dossier_individual_attributes_birthdate', with: '14/10/1987' page.find_by_id('etape_suivante').click - expect(page).to have_current_path(users_dossier_carte_path(procedure_for_individual.dossiers.last.id.to_s), only_path: true) + expect(page).to have_current_path(users_dossier_carte_path(procedure_for_individual.dossiers.last.id.to_s)) page.find_by_id('etape_suivante').click fill_in "champs_#{procedure_for_individual.dossiers.last.champs.first.id}", with: 'contenu du champ 1' page.find_by_id('suivant').click expect(user.dossiers.first.individual.birthdate).to eq("1987-10-14") - expect(page).to have_current_path(users_dossier_recapitulatif_path(procedure_for_individual.dossiers.last.id.to_s), only_path: true) + expect(page).to have_current_path(users_dossier_recapitulatif_path(procedure_for_individual.dossiers.last.id.to_s)) end end scenario 'Identification through siret', vcr: { cassette_name: 'search_ban_paris' }, js: true do login_as user, scope: :user visit commencer_path(procedure_path: procedure_with_siret.path) - expect(page).to have_current_path(users_dossier_path(procedure_with_siret.dossiers.last.id.to_s), only_path: true) + expect(page).to have_current_path(users_dossier_path(procedure_with_siret.dossiers.last.id.to_s)) fill_in 'dossier-siret', with: siret stub_request(:get, "https://staging.entreprise.api.gouv.fr/v2/etablissements/#{siret}?token=#{SIADETOKEN}") .to_return(status: 200, body: File.read('spec/support/files/etablissement.json')) @@ -59,11 +59,11 @@ feature 'As a User I wanna create a dossier' do expect(page).to have_css('#recap-info-entreprise') find(:css, "#dossier_autorisation_donnees[value='1']").set(true) page.find_by_id('etape_suivante').click - expect(page).to have_current_path(users_dossier_carte_path(procedure_with_siret.dossiers.last.id.to_s), only_path: true) + expect(page).to have_current_path(users_dossier_carte_path(procedure_with_siret.dossiers.last.id.to_s)) page.find_by_id('etape_suivante').click fill_in "champs_#{procedure_with_siret.dossiers.last.champs.first.id}", with: 'contenu du champ 1' page.find_by_id('suivant').click - expect(page).to have_current_path(users_dossier_recapitulatif_path(procedure_with_siret.dossiers.last.id.to_s), only_path: true) + expect(page).to have_current_path(users_dossier_recapitulatif_path(procedure_with_siret.dossiers.last.id.to_s)) end end end diff --git a/spec/features/users/dossier_edition_spec.rb b/spec/features/users/dossier_edition_spec.rb index 86d7f1708..d64311de5 100644 --- a/spec/features/users/dossier_edition_spec.rb +++ b/spec/features/users/dossier_edition_spec.rb @@ -22,7 +22,7 @@ feature 'As a User I want to edit a dossier I own' do scenario 'Getting a dossier, I want to create a new message on', js: true do page.find_by_id('tr_dossier_' + dossier.id.to_s).click - expect(page).to have_current_path(users_dossier_recapitulatif_path(Dossier.first.id.to_s), only_path: true) + expect(page).to have_current_path(users_dossier_recapitulatif_path(Dossier.first.id.to_s)) page.find_by_id('open-message').click page.execute_script("$('#texte_commentaire').data('wysihtml5').editor.setValue('Contenu du nouveau message')") page.find_by_id('save-message').click @@ -31,18 +31,18 @@ feature 'As a User I want to edit a dossier I own' do scenario 'On the same dossier, I want to edit informations', js: true do page.find_by_id('tr_dossier_' + dossier.id.to_s).click - expect(page).to have_current_path(users_dossier_recapitulatif_path(dossier.id.to_s), only_path: true) + expect(page).to have_current_path(users_dossier_recapitulatif_path(dossier.id.to_s)) # Linked Dossier linked_dossier_id = dossier.champs.find { |c| c.type_de_champ.type_champ == 'dossier_link' }.value expect(page).to have_link("Dossier #{linked_dossier_id}") page.find_by_id('edit-dossier').click - expect(page).to have_current_path(users_dossier_description_path(dossier.id.to_s), only_path: true) + expect(page).to have_current_path(users_dossier_description_path(dossier.id.to_s)) champ_id = dossier.champs.find { |t| t.type_champ == "text" }.id fill_in "champs_#{champ_id.to_s}", with: 'Contenu du champ 1' page.find_by_id('modification_terminee').click - expect(page).to have_current_path(users_dossier_recapitulatif_path(dossier.id.to_s), only_path: true) + expect(page).to have_current_path(users_dossier_recapitulatif_path(dossier.id.to_s)) expect(page.find("#champ-#{champ_id}-value").text).to eq('Contenu du champ 1') end end From a2f4e8b283d54cf3a0a92cbab93766a721509c04 Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Tue, 23 Jan 2018 17:15:42 +0100 Subject: [PATCH 18/23] factory_girl is now factory_bot --- Gemfile | 2 +- Gemfile.lock | 4 +- spec/controllers/stats_controller_spec.rb | 52 +++++++++---------- spec/factories/administrateur.rb | 2 +- spec/factories/administration.rb | 2 +- spec/factories/assign_to.rb | 2 +- spec/factories/attestation_template.rb | 2 +- spec/factories/avis.rb | 2 +- spec/factories/cadastre.rb | 2 +- spec/factories/cerfa.rb | 2 +- spec/factories/champ.rb | 12 ++--- spec/factories/commentaire.rb | 2 +- spec/factories/dossier.rb | 2 +- spec/factories/drop_down_list.rb | 2 +- spec/factories/entreprise.rb | 2 +- spec/factories/etablissement.rb | 2 +- spec/factories/exercice.rb | 2 +- spec/factories/follow.rb | 2 +- spec/factories/france_connect_information.rb | 2 +- spec/factories/gestionnaire.rb | 2 +- spec/factories/individual.rb | 2 +- spec/factories/invite.rb | 2 +- spec/factories/invite_user.rb | 2 +- spec/factories/mail_templates.rb | 2 +- spec/factories/module_api_carto.rb | 2 +- spec/factories/notification.rb | 2 +- spec/factories/piece_justificative.rb | 2 +- spec/factories/procedure.rb | 2 +- spec/factories/procedure_path.rb | 2 +- spec/factories/quartier_prioritaire.rb | 2 +- spec/factories/rna_information.rb | 2 +- spec/factories/type_de_champ_private.rb | 2 +- spec/factories/type_de_champ_public.rb | 2 +- spec/factories/type_de_piece_justificative.rb | 2 +- spec/factories/user.rb | 2 +- .../new_gestionnaire/gestionnaire_spec.rb | 2 +- spec/models/commentaire_spec.rb | 2 +- spec/spec_helper.rb | 4 +- spec/support/factory_girl.rb | 2 +- spec/support/feature_helpers.rb | 2 +- 40 files changed, 72 insertions(+), 72 deletions(-) diff --git a/Gemfile b/Gemfile index dd2d8e625..9b8da43bd 100644 --- a/Gemfile +++ b/Gemfile @@ -120,7 +120,7 @@ gem 'rack-mini-profiler' group :test do gem 'capybara' gem 'launchy' - gem 'factory_girl' + gem 'factory_bot' gem 'database_cleaner' gem 'webmock' gem 'shoulda-matchers', require: false diff --git a/Gemfile.lock b/Gemfile.lock index d4d8f6bee..259680f49 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -191,7 +191,7 @@ GEM eventmachine (1.2.1) excon (0.60.0) execjs (2.7.0) - factory_girl (4.9.0) + factory_bot (4.8.2) activesupport (>= 3.0.0) faraday (0.12.2) multipart-post (>= 1.2, < 3) @@ -780,7 +780,7 @@ DEPENDENCIES devise dotenv-rails draper - factory_girl + factory_bot fog fog-openstack font-awesome-rails diff --git a/spec/controllers/stats_controller_spec.rb b/spec/controllers/stats_controller_spec.rb index 625b56133..34594386b 100644 --- a/spec/controllers/stats_controller_spec.rb +++ b/spec/controllers/stats_controller_spec.rb @@ -4,11 +4,11 @@ describe StatsController, type: :controller do describe "#last_four_months_hash" do context "while a regular user is logged in" do before do - FactoryGirl.create(:procedure, :created_at => 6.months.ago, :updated_at => 6.months.ago) - FactoryGirl.create(:procedure, :created_at => 2.months.ago, :updated_at => 62.days.ago) - FactoryGirl.create(:procedure, :created_at => 2.months.ago, :updated_at => 62.days.ago) - FactoryGirl.create(:procedure, :created_at => 2.months.ago, :updated_at => 31.days.ago) - FactoryGirl.create(:procedure, :created_at => 2.months.ago, :updated_at => Time.now) + FactoryBot.create(:procedure, :created_at => 6.months.ago, :updated_at => 6.months.ago) + FactoryBot.create(:procedure, :created_at => 2.months.ago, :updated_at => 62.days.ago) + FactoryBot.create(:procedure, :created_at => 2.months.ago, :updated_at => 62.days.ago) + FactoryBot.create(:procedure, :created_at => 2.months.ago, :updated_at => 31.days.ago) + FactoryBot.create(:procedure, :created_at => 2.months.ago, :updated_at => Time.now) @controller = StatsController.new allow(@controller).to receive(:administration_signed_in?).and_return(false) @@ -28,10 +28,10 @@ describe StatsController, type: :controller do context "while a super admin is logged in" do before do - FactoryGirl.create(:procedure, :updated_at => 6.months.ago) - FactoryGirl.create(:procedure, :updated_at => 45.days.ago) - FactoryGirl.create(:procedure, :updated_at => 1.day.ago) - FactoryGirl.create(:procedure, :updated_at => 1.day.ago) + FactoryBot.create(:procedure, :updated_at => 6.months.ago) + FactoryBot.create(:procedure, :updated_at => 45.days.ago) + FactoryBot.create(:procedure, :updated_at => 1.day.ago) + FactoryBot.create(:procedure, :updated_at => 1.day.ago) @controller = StatsController.new @@ -54,11 +54,11 @@ describe StatsController, type: :controller do describe '#cumulative_hash' do before do Timecop.freeze(Time.new(2016, 10, 2)) - FactoryGirl.create(:procedure, :created_at => 55.days.ago, :updated_at => 43.days.ago) - FactoryGirl.create(:procedure, :created_at => 45.days.ago, :updated_at => 40.days.ago) - FactoryGirl.create(:procedure, :created_at => 45.days.ago, :updated_at => 20.days.ago) - FactoryGirl.create(:procedure, :created_at => 15.days.ago, :updated_at => 20.days.ago) - FactoryGirl.create(:procedure, :created_at => 15.days.ago, :updated_at => 1.hour.ago) + FactoryBot.create(:procedure, :created_at => 55.days.ago, :updated_at => 43.days.ago) + FactoryBot.create(:procedure, :created_at => 45.days.ago, :updated_at => 40.days.ago) + FactoryBot.create(:procedure, :created_at => 45.days.ago, :updated_at => 20.days.ago) + FactoryBot.create(:procedure, :created_at => 15.days.ago, :updated_at => 20.days.ago) + FactoryBot.create(:procedure, :created_at => 15.days.ago, :updated_at => 1.hour.ago) end after { Timecop.return } @@ -142,21 +142,21 @@ describe StatsController, type: :controller do # dossier_p1_c: 5 days before do - procedure_1 = FactoryGirl.create(:procedure) - procedure_2 = FactoryGirl.create(:procedure) - dossier_p1_a = FactoryGirl.create(:dossier, + procedure_1 = FactoryBot.create(:procedure) + procedure_2 = FactoryBot.create(:procedure) + dossier_p1_a = FactoryBot.create(:dossier, :procedure => procedure_1, :en_construction_at => 2.months.ago.beginning_of_month, :processed_at => 2.months.ago.beginning_of_month + 3.days) - dossier_p1_b = FactoryGirl.create(:dossier, + dossier_p1_b = FactoryBot.create(:dossier, :procedure => procedure_1, :en_construction_at => 2.months.ago.beginning_of_month, :processed_at => 2.months.ago.beginning_of_month + 1.days) - dossier_p1_c = FactoryGirl.create(:dossier, + dossier_p1_c = FactoryBot.create(:dossier, :procedure => procedure_1, :en_construction_at => 1.months.ago.beginning_of_month, :processed_at => 1.months.ago.beginning_of_month + 5.days) - dossier_p2_a = FactoryGirl.create(:dossier, + dossier_p2_a = FactoryBot.create(:dossier, :procedure => procedure_2, :en_construction_at => 2.month.ago.beginning_of_month, :processed_at => 2.month.ago.beginning_of_month + 4.days) @@ -190,24 +190,24 @@ describe StatsController, type: :controller do # dossier_p1_c: 50 minutes before do - procedure_1 = FactoryGirl.create(:procedure, :with_type_de_champ, :types_de_champ_count => 24) - procedure_2 = FactoryGirl.create(:procedure, :with_type_de_champ, :types_de_champ_count => 48) - dossier_p1_a = FactoryGirl.create(:dossier, + procedure_1 = FactoryBot.create(:procedure, :with_type_de_champ, :types_de_champ_count => 24) + procedure_2 = FactoryBot.create(:procedure, :with_type_de_champ, :types_de_champ_count => 48) + dossier_p1_a = FactoryBot.create(:dossier, :procedure => procedure_1, :created_at => 2.months.ago.beginning_of_month, :en_construction_at => 2.months.ago.beginning_of_month + 30.minutes, :processed_at => 2.months.ago.beginning_of_month + 1.day) - dossier_p1_b = FactoryGirl.create(:dossier, + dossier_p1_b = FactoryBot.create(:dossier, :procedure => procedure_1, :created_at => 2.months.ago.beginning_of_month, :en_construction_at => 2.months.ago.beginning_of_month + 10.minutes, :processed_at => 2.months.ago.beginning_of_month + 1.day) - dossier_p1_c = FactoryGirl.create(:dossier, + dossier_p1_c = FactoryBot.create(:dossier, :procedure => procedure_1, :created_at => 1.months.ago.beginning_of_month, :en_construction_at => 1.months.ago.beginning_of_month + 50.minutes, :processed_at => 1.months.ago.beginning_of_month + 1.day) - dossier_p2_a = FactoryGirl.create(:dossier, + dossier_p2_a = FactoryBot.create(:dossier, :procedure => procedure_2, :created_at => 2.month.ago.beginning_of_month, :en_construction_at => 2.month.ago.beginning_of_month + 80.minutes, diff --git a/spec/factories/administrateur.rb b/spec/factories/administrateur.rb index f81e5a6a9..be7cac11a 100644 --- a/spec/factories/administrateur.rb +++ b/spec/factories/administrateur.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do sequence(:administrateur_email) { |n| "admin#{n}@admin.com" } factory :administrateur do email { generate(:administrateur_email) } diff --git a/spec/factories/administration.rb b/spec/factories/administration.rb index 216a5b70c..5f55b5971 100644 --- a/spec/factories/administration.rb +++ b/spec/factories/administration.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do sequence(:administration_email) { |n| "plop#{n}@plop.com" } factory :administration do email { generate(:administration_email) } diff --git a/spec/factories/assign_to.rb b/spec/factories/assign_to.rb index 82976c8b9..7a5110f36 100644 --- a/spec/factories/assign_to.rb +++ b/spec/factories/assign_to.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :assign_to do end end diff --git a/spec/factories/attestation_template.rb b/spec/factories/attestation_template.rb index 46eb4bee1..faefd5e5c 100644 --- a/spec/factories/attestation_template.rb +++ b/spec/factories/attestation_template.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :attestation_template do title 'title' body 'body' diff --git a/spec/factories/avis.rb b/spec/factories/avis.rb index 90d830c8f..679b16605 100644 --- a/spec/factories/avis.rb +++ b/spec/factories/avis.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :avis do introduction 'Bonjour, merci de me donner votre avis sur ce dossier' diff --git a/spec/factories/cadastre.rb b/spec/factories/cadastre.rb index 5323ff278..fe6833b4e 100644 --- a/spec/factories/cadastre.rb +++ b/spec/factories/cadastre.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :cadastre do numero '001' feuille 1 diff --git a/spec/factories/cerfa.rb b/spec/factories/cerfa.rb index 7e29db2ac..c6ccc5bc4 100644 --- a/spec/factories/cerfa.rb +++ b/spec/factories/cerfa.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :cerfa do end end diff --git a/spec/factories/champ.rb b/spec/factories/champ.rb index a53ae8808..ee5917834 100644 --- a/spec/factories/champ.rb +++ b/spec/factories/champ.rb @@ -1,21 +1,21 @@ -FactoryGirl.define do +FactoryBot.define do factory :champ do - type_de_champ { FactoryGirl.create(:type_de_champ_public) } + type_de_champ { FactoryBot.create(:type_de_champ_public) } trait :checkbox do - type_de_champ { FactoryGirl.create(:type_de_champ_public, :checkbox) } + type_de_champ { FactoryBot.create(:type_de_champ_public, :checkbox) } end trait :header_section do - type_de_champ { FactoryGirl.create(:type_de_champ_public, :header_section) } + type_de_champ { FactoryBot.create(:type_de_champ_public, :header_section) } end trait :explication do - type_de_champ { FactoryGirl.create(:type_de_champ_public, :explication) } + type_de_champ { FactoryBot.create(:type_de_champ_public, :explication) } end trait :dossier_link do - type_de_champ { FactoryGirl.create(:type_de_champ_public, :type_dossier_link) } + type_de_champ { FactoryBot.create(:type_de_champ_public, :type_dossier_link) } end end end diff --git a/spec/factories/commentaire.rb b/spec/factories/commentaire.rb index 6242281e4..c03091049 100644 --- a/spec/factories/commentaire.rb +++ b/spec/factories/commentaire.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :commentaire do body 'plop' diff --git a/spec/factories/dossier.rb b/spec/factories/dossier.rb index 9b1ce3a04..4fa1978de 100644 --- a/spec/factories/dossier.rb +++ b/spec/factories/dossier.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :dossier do state 'brouillon' association :user, factory: [:user] diff --git a/spec/factories/drop_down_list.rb b/spec/factories/drop_down_list.rb index 0aeabf30d..9b7de1e7e 100644 --- a/spec/factories/drop_down_list.rb +++ b/spec/factories/drop_down_list.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :drop_down_list do value "val1\r\nval2\r\n--separateur--\r\nval3" end diff --git a/spec/factories/entreprise.rb b/spec/factories/entreprise.rb index 95a2ae53c..51752b3b8 100644 --- a/spec/factories/entreprise.rb +++ b/spec/factories/entreprise.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :entreprise do siren '440117620' capital_social 537_100_000 diff --git a/spec/factories/etablissement.rb b/spec/factories/etablissement.rb index 2a442271d..3c4d43be5 100644 --- a/spec/factories/etablissement.rb +++ b/spec/factories/etablissement.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :etablissement do siret '44011762001530' siege_social true diff --git a/spec/factories/exercice.rb b/spec/factories/exercice.rb index bf804d551..b9c6f38cc 100644 --- a/spec/factories/exercice.rb +++ b/spec/factories/exercice.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :exercice do ca '12345678' dateFinExercice "2014-12-30 23:00:00" diff --git a/spec/factories/follow.rb b/spec/factories/follow.rb index 9db1f67ce..fb8047450 100644 --- a/spec/factories/follow.rb +++ b/spec/factories/follow.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :follow do end end diff --git a/spec/factories/france_connect_information.rb b/spec/factories/france_connect_information.rb index 522552cca..64f5ac533 100644 --- a/spec/factories/france_connect_information.rb +++ b/spec/factories/france_connect_information.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :france_connect_information do given_name 'plop' family_name 'plip' diff --git a/spec/factories/gestionnaire.rb b/spec/factories/gestionnaire.rb index 02ee8d5eb..1595ce313 100644 --- a/spec/factories/gestionnaire.rb +++ b/spec/factories/gestionnaire.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do sequence(:gestionnaire_email) { |n| "gest#{n}@gest.com" } factory :gestionnaire do email { generate(:gestionnaire_email) } diff --git a/spec/factories/individual.rb b/spec/factories/individual.rb index 0e2330b20..05128e117 100644 --- a/spec/factories/individual.rb +++ b/spec/factories/individual.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :individual do gender 'M.' nom 'Julien' diff --git a/spec/factories/invite.rb b/spec/factories/invite.rb index 3e8083023..ec5142cc2 100644 --- a/spec/factories/invite.rb +++ b/spec/factories/invite.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :invite do email 'plop@octo.com' diff --git a/spec/factories/invite_user.rb b/spec/factories/invite_user.rb index 01280169b..e1cc5a6f6 100644 --- a/spec/factories/invite_user.rb +++ b/spec/factories/invite_user.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :invite_user do email 'plop@octo.com' diff --git a/spec/factories/mail_templates.rb b/spec/factories/mail_templates.rb index 43f358bdb..ab8b31ab2 100644 --- a/spec/factories/mail_templates.rb +++ b/spec/factories/mail_templates.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :closed_mail, class: Mails::ClosedMail do subject "Subject, voila voila" body "Blabla ceci est mon body" diff --git a/spec/factories/module_api_carto.rb b/spec/factories/module_api_carto.rb index 742bea6e6..d76698ee5 100644 --- a/spec/factories/module_api_carto.rb +++ b/spec/factories/module_api_carto.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :module_api_carto do use_api_carto false quartiers_prioritaires false diff --git a/spec/factories/notification.rb b/spec/factories/notification.rb index fc1a119fb..b8a9c81aa 100644 --- a/spec/factories/notification.rb +++ b/spec/factories/notification.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :notification do type_notif 'commentaire' liste [] diff --git a/spec/factories/piece_justificative.rb b/spec/factories/piece_justificative.rb index abe3f319c..c15d09d18 100644 --- a/spec/factories/piece_justificative.rb +++ b/spec/factories/piece_justificative.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :piece_justificative do trait :rib do content Rack::Test::UploadedFile.new("./spec/support/files/RIB.pdf", 'application/pdf') diff --git a/spec/factories/procedure.rb b/spec/factories/procedure.rb index 46477a14b..29892706d 100644 --- a/spec/factories/procedure.rb +++ b/spec/factories/procedure.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do sequence(:published_path) { |n| "fake_path#{n}" } factory :procedure do lien_demarche 'http://localhost' diff --git a/spec/factories/procedure_path.rb b/spec/factories/procedure_path.rb index 4620abe6e..651696899 100644 --- a/spec/factories/procedure_path.rb +++ b/spec/factories/procedure_path.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :procedure_path do path 'fake_path' end diff --git a/spec/factories/quartier_prioritaire.rb b/spec/factories/quartier_prioritaire.rb index 7cc428083..3d1de0e59 100644 --- a/spec/factories/quartier_prioritaire.rb +++ b/spec/factories/quartier_prioritaire.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :quartier_prioritaire do code 'QPcode' commune 'Paris' diff --git a/spec/factories/rna_information.rb b/spec/factories/rna_information.rb index 70aef163d..bba5d5371 100644 --- a/spec/factories/rna_information.rb +++ b/spec/factories/rna_information.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :rna_information do association_id "W072000535" titre "ASSOCIATION POUR LA PROMOTION DE SPECTACLES AU CHATEAU DE ROCHEMAURE" diff --git a/spec/factories/type_de_champ_private.rb b/spec/factories/type_de_champ_private.rb index 327a9e80f..d804dd42b 100644 --- a/spec/factories/type_de_champ_private.rb +++ b/spec/factories/type_de_champ_private.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :type_de_champ_private do sequence(:libelle) { |n| "Libelle champ privé #{n}" } sequence(:description) { |n| "description du champ privé #{n}" } diff --git a/spec/factories/type_de_champ_public.rb b/spec/factories/type_de_champ_public.rb index 0add6b480..7f63092cf 100644 --- a/spec/factories/type_de_champ_public.rb +++ b/spec/factories/type_de_champ_public.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :type_de_champ_public do sequence(:libelle) { |n| "Libelle du champ #{n}" } sequence(:description) { |n| "description du champ #{n}" } diff --git a/spec/factories/type_de_piece_justificative.rb b/spec/factories/type_de_piece_justificative.rb index 76af4cf37..b461f700e 100644 --- a/spec/factories/type_de_piece_justificative.rb +++ b/spec/factories/type_de_piece_justificative.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :type_de_piece_justificative do libelle 'RIB' description 'Releve identité bancaire' diff --git a/spec/factories/user.rb b/spec/factories/user.rb index c2d09396b..eedc7efd1 100644 --- a/spec/factories/user.rb +++ b/spec/factories/user.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do sequence(:user_email) { |n| "user#{n}@user.com" } factory :user do email { generate(:user_email) } diff --git a/spec/features/new_gestionnaire/gestionnaire_spec.rb b/spec/features/new_gestionnaire/gestionnaire_spec.rb index ed4cacc89..cd9f01d41 100644 --- a/spec/features/new_gestionnaire/gestionnaire_spec.rb +++ b/spec/features/new_gestionnaire/gestionnaire_spec.rb @@ -107,7 +107,7 @@ feature 'The gestionnaire part' do end scenario 'A gestionnaire can see the personnes impliquées' do - gestionnaire2 = FactoryGirl.create(:gestionnaire, password: password) + gestionnaire2 = FactoryBot.create(:gestionnaire, password: password) log_in(gestionnaire.email, password) diff --git a/spec/models/commentaire_spec.rb b/spec/models/commentaire_spec.rb index 802f9ae85..a476cca39 100644 --- a/spec/models/commentaire_spec.rb +++ b/spec/models/commentaire_spec.rb @@ -30,7 +30,7 @@ describe Commentaire do let(:user_invite) { create(:user) } before do - FactoryGirl.create(:invite_user, email: "invite@tps.apientreprise.fr", dossier: dossier, user: user_invite) + FactoryBot.create(:invite_user, email: "invite@tps.apientreprise.fr", dossier: dossier, user: user_invite) end it "calls notify_gestionnaires" do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 4960225b8..8ab5e7d15 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -26,7 +26,7 @@ require 'database_cleaner' require 'webmock/rspec' require 'shoulda-matchers' require 'devise' -require 'factory_girl' +require 'factory_bot' require 'selenium/webdriver' Capybara.javascript_driver = :headless_chrome @@ -109,7 +109,7 @@ RSpec.configure do |config| config.include Devise::Test::ControllerHelpers, type: :controller config.include Devise::Test::ControllerHelpers, type: :view - config.include FactoryGirl::Syntax::Methods + config.include FactoryBot::Syntax::Methods config.before(:each) do allow_any_instance_of(PieceJustificativeUploader).to receive(:generate_secure_token).and_return("3dbb3535-5388-4a37-bc2d-778327b9f997") diff --git a/spec/support/factory_girl.rb b/spec/support/factory_girl.rb index eec437fb3..c7890e49c 100644 --- a/spec/support/factory_girl.rb +++ b/spec/support/factory_girl.rb @@ -1,3 +1,3 @@ RSpec.configure do |config| - config.include FactoryGirl::Syntax::Methods + config.include FactoryBot::Syntax::Methods end diff --git a/spec/support/feature_helpers.rb b/spec/support/feature_helpers.rb index 57f7f3291..2e59ec736 100644 --- a/spec/support/feature_helpers.rb +++ b/spec/support/feature_helpers.rb @@ -11,7 +11,7 @@ module FeatureHelpers end def create_dossier - dossier = FactoryGirl.create(:dossier) + dossier = FactoryBot.create(:dossier) dossier end end From 506a50547787354e617a03dd42431af7f34ece4e Mon Sep 17 00:00:00 2001 From: Frederic Merizen Date: Tue, 23 Jan 2018 16:21:43 +0100 Subject: [PATCH 19/23] [#1360] Upgrade SmartListing to fork of 1.2.1 --- Gemfile | 5 ++- Gemfile.lock | 18 ++++++---- .../admin/accompagnateurs_controller.rb | 19 +++++++++++ .../admin/gestionnaires_controller.rb | 6 ++++ .../admin/procedures_controller.rb | 18 ++++++++++ app/controllers/application_controller.rb | 27 +++++++++++++++ app/controllers/users/dossiers_controller.rb | 6 ++++ .../admin/gestionnaires_controller_spec.rb | 11 +++++++ .../admin/procedures_controller_spec.rb | 33 +++++++++++++++++++ 9 files changed, 136 insertions(+), 7 deletions(-) diff --git a/Gemfile b/Gemfile index 9b8da43bd..a2cf98132 100644 --- a/Gemfile +++ b/Gemfile @@ -76,7 +76,10 @@ gem 'hashie' gem 'mailjet' -gem 'smart_listing' +# FIXME: this is a fork, go back to official version +# once https://github.com/Sology/smart_listing/pull/139 +# has been merged and released +gem 'smart_listing', git: 'https://github.com/mizinsky/smart_listing.git', branch: 'kaminari-update' gem 'bootstrap-wysihtml5-rails', '~> 0.3.3.8' diff --git a/Gemfile.lock b/Gemfile.lock index 259680f49..dd78b407a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -15,6 +15,17 @@ GIT open4 (~> 1.3.4) rake +GIT + remote: https://github.com/mizinsky/smart_listing.git + revision: bcdd4f25954fc6f4faa3d6ea6ea9a69c65da678b + branch: kaminari-update + specs: + smart_listing (1.2.1) + coffee-rails + jquery-rails + kaminari (>= 0.17) + rails (>= 3.2) + GEM remote: https://rubygems.org/ specs: @@ -671,11 +682,6 @@ GEM tilt (~> 2.0) skylight (1.5.0) activesupport (>= 3.0.0) - smart_listing (1.2.0) - coffee-rails - jquery-rails - kaminari (~> 0.17) - rails (>= 3.2) spreadsheet_architect (2.0.2) axlsx (>= 2.0) axlsx_styler (>= 0.1.7) @@ -827,7 +833,7 @@ DEPENDENCIES shoulda-matchers simple_form skylight - smart_listing + smart_listing! spreadsheet_architect spring spring-commands-rspec diff --git a/app/controllers/admin/accompagnateurs_controller.rb b/app/controllers/admin/accompagnateurs_controller.rb index 259f6112f..1f7ca7c7f 100644 --- a/app/controllers/admin/accompagnateurs_controller.rb +++ b/app/controllers/admin/accompagnateurs_controller.rb @@ -6,6 +6,16 @@ class Admin::AccompagnateursController < AdminController def show assign_scope = @procedure.gestionnaires + + # FIXME: remove this comment (no code to remove) when + # https://github.com/Sology/smart_listing/issues/134 + # is fixed. + # + # No need to permit parameters for smart_listing, because + # there are no sortable columns + # + # END OF FIXME + @accompagnateurs_assign = smart_listing_create :accompagnateurs_assign, assign_scope, partial: "admin/accompagnateurs/list_assign", @@ -14,6 +24,15 @@ class Admin::AccompagnateursController < AdminController not_assign_scope = current_administrateur.gestionnaires.where.not(id: assign_scope.ids) not_assign_scope = not_assign_scope.where("email LIKE ?", "%#{params[:filter]}%") if params[:filter] + # FIXME: remove this comment (no code to remove) when + # https://github.com/Sology/smart_listing/issues/134 + # is fixed. + # + # No need to permit parameters for smart_listing, because + # there are no sortable columns + # + # END OF FIXME + @accompagnateurs_not_assign = smart_listing_create :accompagnateurs_not_assign, not_assign_scope, partial: "admin/accompagnateurs/list_not_assign", diff --git a/app/controllers/admin/gestionnaires_controller.rb b/app/controllers/admin/gestionnaires_controller.rb index e8f1848f3..f6bdb1966 100644 --- a/app/controllers/admin/gestionnaires_controller.rb +++ b/app/controllers/admin/gestionnaires_controller.rb @@ -3,6 +3,12 @@ class Admin::GestionnairesController < AdminController helper SmartListing::Helper def index + # FIXME: remove when + # https://github.com/Sology/smart_listing/issues/134 + # is fixed + permit_smart_listing_params + # END OF FIXME + @gestionnaires = smart_listing_create :gestionnaires, current_administrateur.gestionnaires, partial: "admin/gestionnaires/list", diff --git a/app/controllers/admin/procedures_controller.rb b/app/controllers/admin/procedures_controller.rb index e451af182..c827ad5b6 100644 --- a/app/controllers/admin/procedures_controller.rb +++ b/app/controllers/admin/procedures_controller.rb @@ -5,6 +5,12 @@ class Admin::ProceduresController < AdminController before_action :retrieve_procedure, only: [:show, :edit] def index + # FIXME: remove when + # https://github.com/Sology/smart_listing/issues/134 + # is fixed + permit_smart_listing_params + # END OF FIXME + @procedures = smart_listing_create :procedures, current_administrateur.procedures.publiees.order(published_at: :desc), partial: "admin/procedures/list", @@ -14,6 +20,12 @@ class Admin::ProceduresController < AdminController end def archived + # FIXME: remove when + # https://github.com/Sology/smart_listing/issues/134 + # is fixed + permit_smart_listing_params + # END OF FIXME + @procedures = smart_listing_create :procedures, current_administrateur.procedures.archivees.order(published_at: :desc), partial: "admin/procedures/list", @@ -25,6 +37,12 @@ class Admin::ProceduresController < AdminController end def draft + # FIXME: remove when + # https://github.com/Sology/smart_listing/issues/134 + # is fixed + permit_smart_listing_params + # END OF FIXME + @procedures = smart_listing_create :procedures, current_administrateur.procedures.brouillons.order(created_at: :desc), partial: "admin/procedures/list", diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 559acd6df..4fa001a2b 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -109,4 +109,31 @@ class ApplicationController < ActionController::Base }) end end + + def permit_smart_listing_params + # FIXME: remove when + # https://github.com/Sology/smart_listing/issues/134 + # is fixed + self.params = params.permit( + dossiers_smart_listing: + [ + :page, + :per_page, + { sort: [:id, :'procedure.libelle', :state, :updated_at] } + ], + gestionnaires_smart_listing: + [ + :page, + :per_page, + { sort: [:email] } + ], + procedures_smart_listing: + [ + :page, + :per_page, + { sort: [:id, :libelle, :published_at] } + ] + ) + # END OF FIXME + end end diff --git a/app/controllers/users/dossiers_controller.rb b/app/controllers/users/dossiers_controller.rb index 9c042590e..f7effb1ed 100644 --- a/app/controllers/users/dossiers_controller.rb +++ b/app/controllers/users/dossiers_controller.rb @@ -29,6 +29,12 @@ class Users::DossiersController < UsersController return redirect_to users_dossiers_path end + # FIXME: remove when + # https://github.com/Sology/smart_listing/issues/134 + # is fixed + permit_smart_listing_params + # END OF FIXME + @dossiers = smart_listing_create :dossiers, @dossiers_filtered, partial: "users/dossiers/list", diff --git a/spec/controllers/admin/gestionnaires_controller_spec.rb b/spec/controllers/admin/gestionnaires_controller_spec.rb index 3d2bcf246..1e2c701f9 100644 --- a/spec/controllers/admin/gestionnaires_controller_spec.rb +++ b/spec/controllers/admin/gestionnaires_controller_spec.rb @@ -14,6 +14,17 @@ describe Admin::GestionnairesController, type: :controller do it { expect(subject.status).to eq(200) } end + describe 'GET #index with sorting and pagination' do + subject { + get :index, + 'gestionnaires_smart_listing[page]': 1, + 'gestionnaires_smart_listing[per_page]': 10, + 'gestionnaires_smart_listing[sort][email]': 'asc' + } + + it { expect(subject.status).to eq(200) } + end + describe 'POST #create' do let(:email) { 'test@plop.com' } let(:procedure_id) { nil } diff --git a/spec/controllers/admin/procedures_controller_spec.rb b/spec/controllers/admin/procedures_controller_spec.rb index 829b3a7cb..2ea08fd37 100644 --- a/spec/controllers/admin/procedures_controller_spec.rb +++ b/spec/controllers/admin/procedures_controller_spec.rb @@ -42,18 +42,51 @@ describe Admin::ProceduresController, type: :controller do it { expect(response.status).to eq(200) } end + describe 'GET #index with sorting and pagination' do + subject { + get :index, + 'procedures_smart_listing[page]': 1, + 'procedures_smart_listing[per_page]': 10, + 'procedures_smart_listing[sort][id]': 'asc' + } + + it { expect(subject.status).to eq(200) } + end + describe 'GET #archived' do subject { get :archived } it { expect(response.status).to eq(200) } end + describe 'GET #archived with sorting and pagination' do + subject { + get :archived, + 'procedures_smart_listing[page]': 1, + 'procedures_smart_listing[per_page]': 10, + 'procedures_smart_listing[sort][libelle]': 'asc' + } + + it { expect(subject.status).to eq(200) } + end + describe 'GET #published' do subject { get :published } it { expect(response.status).to eq(200) } end + describe 'GET #draft with sorting and pagination' do + subject { + get :draft, + 'procedures_smart_listing[page]': 1, + 'procedures_smart_listing[per_page]': 10, + 'procedures_smart_listing[sort][published_at]': 'asc' + } + + it { expect(subject.status).to eq(200) } + end + describe 'DELETE #destroy' do let(:procedure_draft) { create :procedure, administrateur: admin, published_at: nil, archived_at: nil } let(:procedure_published) { create :procedure, administrateur: admin, published_at: Time.now, archived_at: nil } From 8b2fc0f8b4b7c5cf49904c027bb60515c1a4591f Mon Sep 17 00:00:00 2001 From: Mathieu Magnin Date: Thu, 25 Jan 2018 12:11:42 +0100 Subject: [PATCH 20/23] Increase password creation delay --- config/initializers/devise.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index c365fd228..cc417f2da 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -189,7 +189,7 @@ Devise.setup do |config| # Time interval you can reset your password with a reset password key. # Don't put a too small interval or your users won't have the time to # change their passwords. - config.reset_password_within = 6.hours + config.reset_password_within = 7.days # ==> Configuration for :encryptable # Allow you to use another encryption algorithm besides bcrypt (default). You can use From 11dbc595c74deebd38a87a4101d350a0d0cb9c86 Mon Sep 17 00:00:00 2001 From: Mathieu Magnin Date: Wed, 24 Jan 2018 18:10:40 +0100 Subject: [PATCH 21/23] Store in constant CGU url --- app/views/dossiers/etapes/etape_2/_individual.html.haml | 3 ++- app/views/layouts/_footer.html.haml | 2 +- app/views/layouts/_new_footer.html.haml | 2 +- config/initializers/urls.rb | 2 ++ 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/views/dossiers/etapes/etape_2/_individual.html.haml b/app/views/dossiers/etapes/etape_2/_individual.html.haml index 2a3abc435..bb7c8e55f 100644 --- a/app/views/dossiers/etapes/etape_2/_individual.html.haml +++ b/app/views/dossiers/etapes/etape_2/_individual.html.haml @@ -36,7 +36,8 @@ %p %label{ style: 'font-weight: normal;' } = f.check_box :autorisation_donnees -  J'accepte les CGU. +  J'accepte + = link_to "les CGU", CGU_URL, target: :blank .row .col-xs-5.col-xs-5 .col-xs-2.col-xs-2 diff --git a/app/views/layouts/_footer.html.haml b/app/views/layouts/_footer.html.haml index 71379539c..d2ed0870a 100644 --- a/app/views/layouts/_footer.html.haml +++ b/app/views/layouts/_footer.html.haml @@ -7,6 +7,6 @@ \- = link_to 'Statistiques', stats_path \- - = link_to 'CGU / Mentions légales', "https://tps.gitbooks.io/tps-documentation/content/conditions-generales-dutilisation.html" + = link_to 'CGU / Mentions légales', CGU_URL \- = link_to 'Contact', "mailto:"+t('dynamics.contact_email') diff --git a/app/views/layouts/_new_footer.html.haml b/app/views/layouts/_new_footer.html.haml index 7b421a978..97e7fb821 100644 --- a/app/views/layouts/_new_footer.html.haml +++ b/app/views/layouts/_new_footer.html.haml @@ -21,7 +21,7 @@ %li.footer-link = link_to "Statistiques", stats_path, :class => "footer-link" %li.footer-link - = link_to "CGU", "https://tps.gitbooks.io/tps-documentation/content/conditions-generales-dutilisation.html", :class => "footer-link", :target => "_blank" + = link_to "CGU", CGU_URL, :class => "footer-link", :target => "_blank" %li.footer-column %ul.footer-links diff --git a/config/initializers/urls.rb b/config/initializers/urls.rb index 7bc572d7d..cf385571e 100644 --- a/config/initializers/urls.rb +++ b/config/initializers/urls.rb @@ -3,3 +3,5 @@ if Rails.env.production? else SIADEURL = 'https://staging.entreprise.api.gouv.fr' end + +CGU_URL = "https://tps.gitbooks.io/tps-documentation/content/conditions-generales-dutilisation.html" From 839c0e6aa986f65f23fbb2f3f3086cbdf246eb2b Mon Sep 17 00:00:00 2001 From: Mathieu Magnin Date: Wed, 24 Jan 2018 18:15:06 +0100 Subject: [PATCH 22/23] Invite admin mail is previewable --- spec/mailers/previews/administration_mailer_preview.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spec/mailers/previews/administration_mailer_preview.rb b/spec/mailers/previews/administration_mailer_preview.rb index d0a6e2554..c81507808 100644 --- a/spec/mailers/previews/administration_mailer_preview.rb +++ b/spec/mailers/previews/administration_mailer_preview.rb @@ -6,4 +6,8 @@ class AdministrationMailerPreview < ActionMailer::Preview ] AdministrationMailer.dubious_procedures(procedures_and_champs) end + + def invite_admin + AdministrationMailer.invite_admin(Administrateur.last, "12345678") + end end From ce5ce78effa375c6b721c0e836d95ab4163acedd Mon Sep 17 00:00:00 2001 From: Mathieu Magnin Date: Wed, 24 Jan 2018 18:15:32 +0100 Subject: [PATCH 23/23] [Fix #1291] Add CGU link to invite_admin mail template --- app/views/administration_mailer/invite_admin.html.haml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/views/administration_mailer/invite_admin.html.haml b/app/views/administration_mailer/invite_admin.html.haml index 6693ae419..fc11aecfb 100644 --- a/app/views/administration_mailer/invite_admin.html.haml +++ b/app/views/administration_mailer/invite_admin.html.haml @@ -14,3 +14,7 @@ Bonne journée, %br %br L'équipe Téléprocédures Simplifiées +%br +%br +Nous vous rappelons qu'en utilisant notre service, vous vous engagez à respecter nos += link_to "conditions générales d'utilisation", CGU_URL