From e56d122ef6d3390a7c880493e4ff031dfd6ccce5 Mon Sep 17 00:00:00 2001 From: Anna Topalidi Date: Wed, 20 Sep 2023 21:26:43 +0200 Subject: [PATCH] upgrade decidim 27 --- .github/workflows/lint.yml | 2 +- .github/workflows/test.yml | 4 +- .ruby-version | 2 +- Gemfile.lock | 584 ++++++++++-------- .../admin/create_delegation.rb | 2 +- .../admin/create_participant.rb | 2 +- .../admin/create_ponderation.rb | 2 +- .../action_delegator/admin/create_setting.rb | 2 +- .../admin/fix_resource_permissions.rb | 2 +- .../admin/update_participant.rb | 2 +- .../admin/update_ponderation.rb | 2 +- .../action_delegator/admin/update_setting.rb | 2 +- .../devise/sessions_controller_override.rb | 2 - .../admin/manage_participants_controller.rb | 2 +- .../admin/settings_controller.rb | 2 +- .../decidim/action_delegator/send_sms_job.rb | 1 + .../decidim/action_delegator/participant.rb | 14 +- .../consultation_delegations.rb | 2 +- .../delegates_votes_by_consultation.rb | 2 +- .../delegates_votes_by_question.rb | 2 +- .../action_delegator/delegation_votes.rb | 2 +- .../organization_delegations.rb | 2 +- .../action_delegator/organization_settings.rb | 2 +- .../decidim/action_delegator/responses.rb | 2 +- .../responses_by_membership.rb | 2 +- .../action_delegator/setting_delegations.rb | 2 +- .../sum_of_membership_weight.rb | 2 +- .../action_delegator/sum_of_weights.rb | 2 +- .../action_delegator/type_and_weight.rb | 2 +- .../voted_with_ponderations.rb | 2 +- decidim-action_delegator.gemspec | 3 +- details.csv | 1 - .../verifications/delegations_authorizer.rb | 4 +- lib/decidim/action_delegator/version.rb | 6 +- .../admin/create_participant_spec.rb | 4 +- .../admin/create_ponderation_spec.rb | 4 +- .../admin/create_setting_spec.rb | 10 +- .../multiple_vote_question_spec.rb | 2 +- .../consultations/vote_question_spec.rb | 2 +- .../admin/delegations_controller_spec.rb | 4 +- .../invite_participants_controller_spec.rb | 4 +- .../manage_participants_controller_spec.rb | 2 +- .../admin/participants_controller_spec.rb | 2 +- .../admin/ponderations_controller_spec.rb | 2 +- .../admin/settings_controller_spec.rb | 6 +- spec/i18n_spec.rb | 2 +- .../export_consultation_results_job_spec.rb | 14 +- .../twilio_send_sms_job_spec.rb | 2 +- spec/lib/overrides_spec.rb | 12 +- .../action_delegator/delegation_spec.rb | 4 +- .../delegation_permissions_spec.rb | 14 +- .../action_delegator/permissions_spec.rb | 14 +- .../sum_of_membership_weight_spec.rb | 2 +- .../consultation_results_serializer_spec.rb | 3 +- .../sum_of_weights_serializer_spec.rb | 3 +- .../delegations_csv_importer_spec.rb | 4 +- .../action_delegator/sms_gateway_spec.rb | 3 +- .../shared_examples/export_controller.rb | 2 +- spec/tasks/import_direct_verification_spec.rb | 8 +- 59 files changed, 418 insertions(+), 380 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 66f8eb4c..976384aa 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -9,7 +9,7 @@ on: env: CI: "true" - RUBY_VERSION: 2.7.7 + RUBY_VERSION: 3.0.6 NODE_VERSION: 16.9.1 jobs: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 37f61fb4..c03d2d5f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,7 @@ on: pull_request: env: - RUBY_VERSION: 2.7.7 + RUBY_VERSION: 3.0.6 jobs: test: @@ -55,4 +55,4 @@ jobs: path: ./spec/decidim_dummy_app/tmp/screenshots - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v3 \ No newline at end of file + uses: codecov/codecov-action@v3 diff --git a/.ruby-version b/.ruby-version index 1f7da99d..818bd47a 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.7.7 +3.0.6 diff --git a/Gemfile.lock b/Gemfile.lock index 057aff53..c02f3098 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,10 +1,10 @@ PATH remote: . specs: - decidim-action_delegator (0.7.2) - decidim-admin (>= 0.26.0, < 0.27) - decidim-consultations (>= 0.26.0, < 0.27) - decidim-core (>= 0.26.0, < 0.27) + decidim-action_delegator (0.7.3) + decidim-admin (>= 0.27.0, < 0.28) + decidim-consultations (>= 0.27.0, < 0.28) + decidim-core (>= 0.27.0, < 0.28) deface (>= 1.9) savon twilio-ruby @@ -12,38 +12,40 @@ PATH GEM remote: https://rubygems.org/ specs: - actioncable (6.0.6) - actionpack (= 6.0.6) + actioncable (6.1.7.6) + actionpack (= 6.1.7.6) + activesupport (= 6.1.7.6) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.0.6) - actionpack (= 6.0.6) - activejob (= 6.0.6) - activerecord (= 6.0.6) - activestorage (= 6.0.6) - activesupport (= 6.0.6) + actionmailbox (6.1.7.6) + actionpack (= 6.1.7.6) + activejob (= 6.1.7.6) + activerecord (= 6.1.7.6) + activestorage (= 6.1.7.6) + activesupport (= 6.1.7.6) mail (>= 2.7.1) - actionmailer (6.0.6) - actionpack (= 6.0.6) - actionview (= 6.0.6) - activejob (= 6.0.6) + actionmailer (6.1.7.6) + actionpack (= 6.1.7.6) + actionview (= 6.1.7.6) + activejob (= 6.1.7.6) + activesupport (= 6.1.7.6) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.0.6) - actionview (= 6.0.6) - activesupport (= 6.0.6) - rack (~> 2.0, >= 2.0.8) + actionpack (6.1.7.6) + actionview (= 6.1.7.6) + activesupport (= 6.1.7.6) + rack (~> 2.0, >= 2.0.9) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.0.6) - actionpack (= 6.0.6) - activerecord (= 6.0.6) - activestorage (= 6.0.6) - activesupport (= 6.0.6) + actiontext (6.1.7.6) + actionpack (= 6.1.7.6) + activerecord (= 6.1.7.6) + activestorage (= 6.1.7.6) + activesupport (= 6.1.7.6) nokogiri (>= 1.8.5) - actionview (6.0.6) - activesupport (= 6.0.6) + actionview (6.1.7.6) + activesupport (= 6.1.7.6) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) @@ -51,34 +53,36 @@ GEM active_link_to (1.0.5) actionpack addressable - activejob (6.0.6) - activesupport (= 6.0.6) + activejob (6.1.7.6) + activesupport (= 6.1.7.6) globalid (>= 0.3.6) - activemodel (6.0.6) - activesupport (= 6.0.6) - activerecord (6.0.6) - activemodel (= 6.0.6) - activesupport (= 6.0.6) - activestorage (6.0.6) - actionpack (= 6.0.6) - activejob (= 6.0.6) - activerecord (= 6.0.6) + activemodel (6.1.7.6) + activesupport (= 6.1.7.6) + activerecord (6.1.7.6) + activemodel (= 6.1.7.6) + activesupport (= 6.1.7.6) + activestorage (6.1.7.6) + actionpack (= 6.1.7.6) + activejob (= 6.1.7.6) + activerecord (= 6.1.7.6) + activesupport (= 6.1.7.6) marcel (~> 1.0) - activesupport (6.0.6) + mini_mime (>= 1.1.0) + activesupport (6.1.7.6) concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - zeitwerk (~> 2.2, >= 2.2.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + zeitwerk (~> 2.3) acts_as_list (0.9.19) activerecord (>= 3.0) - addressable (2.8.1) + addressable (2.8.5) public_suffix (>= 2.0.2, < 6.0) akami (1.3.1) gyoku (>= 0.4.0) nokogiri ast (2.4.2) - axe-core-api (4.6.0) + axe-core-api (4.7.0) dumb_delegator virtus axe-core-rspec (4.1.0) @@ -89,8 +93,9 @@ GEM descendants_tracker (~> 0.0.4) ice_nine (~> 0.11.0) thread_safe (~> 0.3, >= 0.3.1) + base64 (0.1.1) batch-loader (1.5.0) - bcrypt (3.1.18) + bcrypt (3.1.19) better_html (1.0.16) actionview (>= 4.0) activesupport (>= 4.0) @@ -105,7 +110,7 @@ GEM browser (2.7.1) builder (3.2.4) byebug (11.1.3) - capybara (3.38.0) + capybara (3.39.2) addressable matrix mini_mime (>= 0.1.3) @@ -114,7 +119,7 @@ GEM rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) - carrierwave (2.2.2) + carrierwave (2.2.4) activemodel (>= 5.0.0) activesupport (>= 5.0.0) addressable (~> 2.6) @@ -134,9 +139,9 @@ GEM actionpack (>= 5.0) cells (>= 4.1.6, < 5.0.0) charlock_holmes (0.7.7) - chef-utils (18.1.29) + chef-utils (18.3.0) concurrent-ruby - childprocess (3.0.0) + childprocess (4.1.0) codecov (0.6.0) simplecov (>= 0.15, < 0.22) coercible (1.0.0) @@ -148,69 +153,71 @@ GEM coffee-script-source execjs coffee-script-source (1.12.2) - concurrent-ruby (1.1.10) + commonmarker (0.23.10) + concurrent-ruby (1.2.2) crack (0.4.5) rexml crass (1.0.6) - css_parser (1.12.0) + css_parser (1.16.0) addressable - date_validator (0.9.0) - activemodel - activesupport + date (3.3.3) + date_validator (0.12.0) + activemodel (>= 3) + activesupport (>= 3) db-query-matchers (0.10.0) activesupport (>= 4.0, < 7) rspec (~> 3.0) - decidim (0.26.5) - decidim-accountability (= 0.26.5) - decidim-admin (= 0.26.5) - decidim-api (= 0.26.5) - decidim-assemblies (= 0.26.5) - decidim-blogs (= 0.26.5) - decidim-budgets (= 0.26.5) - decidim-comments (= 0.26.5) - decidim-core (= 0.26.5) - decidim-debates (= 0.26.5) - decidim-forms (= 0.26.5) - decidim-generators (= 0.26.5) - decidim-meetings (= 0.26.5) - decidim-pages (= 0.26.5) - decidim-participatory_processes (= 0.26.5) - decidim-proposals (= 0.26.5) - decidim-sortitions (= 0.26.5) - decidim-surveys (= 0.26.5) - decidim-system (= 0.26.5) - decidim-templates (= 0.26.5) - decidim-verifications (= 0.26.5) - decidim-accountability (0.26.5) - decidim-comments (= 0.26.5) - decidim-core (= 0.26.5) - decidim-admin (0.26.5) + decidim (0.27.4) + decidim-accountability (= 0.27.4) + decidim-admin (= 0.27.4) + decidim-api (= 0.27.4) + decidim-assemblies (= 0.27.4) + decidim-blogs (= 0.27.4) + decidim-budgets (= 0.27.4) + decidim-comments (= 0.27.4) + decidim-core (= 0.27.4) + decidim-debates (= 0.27.4) + decidim-forms (= 0.27.4) + decidim-generators (= 0.27.4) + decidim-meetings (= 0.27.4) + decidim-pages (= 0.27.4) + decidim-participatory_processes (= 0.27.4) + decidim-proposals (= 0.27.4) + decidim-sortitions (= 0.27.4) + decidim-surveys (= 0.27.4) + decidim-system (= 0.27.4) + decidim-templates (= 0.27.4) + decidim-verifications (= 0.27.4) + decidim-accountability (0.27.4) + decidim-comments (= 0.27.4) + decidim-core (= 0.27.4) + decidim-admin (0.27.4) active_link_to (~> 1.0) - decidim-core (= 0.26.5) + decidim-core (= 0.27.4) devise (~> 4.7) devise-i18n (~> 1.2) devise_invitable (~> 2.0) - decidim-api (0.26.5) + decidim-api (0.27.4) graphql (~> 1.12, < 1.13) + graphql-docs (~> 2.1.0) rack-cors (~> 1.0) + decidim-assemblies (0.27.4) + decidim-core (= 0.27.4) + decidim-blogs (0.27.4) + decidim-admin (= 0.27.4) + decidim-comments (= 0.27.4) + decidim-core (= 0.27.4) + decidim-budgets (0.27.4) + decidim-comments (= 0.27.4) + decidim-core (= 0.27.4) + decidim-comments (0.27.4) + decidim-core (= 0.27.4) redcarpet (~> 3.5, >= 3.5.1) - decidim-assemblies (0.26.5) - decidim-core (= 0.26.5) - decidim-blogs (0.26.5) - decidim-admin (= 0.26.5) - decidim-comments (= 0.26.5) - decidim-core (= 0.26.5) - decidim-budgets (0.26.5) - decidim-comments (= 0.26.5) - decidim-core (= 0.26.5) - decidim-comments (0.26.5) - decidim-core (= 0.26.5) - redcarpet (~> 3.5, >= 3.5.1) - decidim-consultations (0.26.5) - decidim-admin (= 0.26.5) - decidim-comments (= 0.26.5) - decidim-core (= 0.26.5) - decidim-core (0.26.5) + decidim-consultations (0.27.4) + decidim-admin (= 0.27.4) + decidim-comments (= 0.27.4) + decidim-core (= 0.27.4) + decidim-core (0.27.4) active_link_to (~> 1.0) acts_as_list (~> 0.9) batch-loader (~> 1.2) @@ -219,21 +226,21 @@ GEM cells-erb (~> 0.1.0) cells-rails (~> 0.1.3) charlock_holmes (~> 0.7) - date_validator (~> 0.9.0) - decidim-api (= 0.26.5) + date_validator (~> 0.12.0) + decidim-api (= 0.27.4) devise (~> 4.7) devise-i18n (~> 1.2) diffy (~> 3.3) doorkeeper (~> 5.1) doorkeeper-i18n (~> 4.0) - file_validators (~> 2.1) + file_validators (~> 3.0) fog-local (~> 0.6) - foundation_rails_helper - geocoder (~> 1.7.5) + foundation_rails_helper (~> 4.0) + geocoder (~> 1.8) hashdiff (>= 0.4.0, < 2.0.0) invisible_captcha (~> 0.12) kaminari (~> 1.2, >= 1.2.1) - loofah (~> 2.3.1) + loofah (~> 2.19.0) mime-types (>= 1.16, < 4.0) mini_magick (~> 4.9) mustache (~> 1.1.0) @@ -248,90 +255,89 @@ GEM premailer-rails (~> 1.10) rack (~> 2.2, >= 2.2.3) rack-attack (~> 6.0) - rails (~> 6.0.4) + rails (~> 6.1.0) rails-i18n (~> 6.0) ransack (~> 2.4.1) - rectify (~> 0.13.0) redis (~> 4.1) request_store (~> 1.5.0) rubyXL (~> 3.4) rubyzip (~> 2.0) - searchlight (~> 4.1) seven_zip_ruby (~> 1.3) social-share-button (~> 1.2, >= 1.2.1) valid_email2 (~> 2.1) webpacker (= 6.0.0.rc.5) + webpush (~> 1.1) wisper (~> 2.0) - decidim-debates (0.26.5) - decidim-comments (= 0.26.5) - decidim-core (= 0.26.5) - decidim-dev (0.26.5) + decidim-debates (0.27.4) + decidim-comments (= 0.27.4) + decidim-core (= 0.27.4) + decidim-dev (0.27.4) axe-core-rspec (~> 4.1.0) byebug (~> 11.0) capybara (~> 3.24) db-query-matchers (~> 0.10.0) - decidim (= 0.26.5) + decidim (= 0.27.4) erb_lint (~> 0.0.35) factory_bot_rails (~> 4.8) i18n-tasks (~> 0.9.18) mdl (~> 0.5) - nokogiri (~> 1.12) + nokogiri (~> 1.13) + parallel_tests (~> 3.7) puma (~> 5.0) rails-controller-testing (~> 1.0) - rspec-cells (~> 0.3.4) + rspec-cells (~> 0.3.7) rspec-html-matchers (~> 0.9.1) rspec-rails (~> 4.0) rspec-retry (~> 0.6.2) rspec_junit_formatter (~> 0.3.0) - rubocop (~> 0.92.0) - rubocop-rails (~> 2.8) - rubocop-rspec (= 1.43.2) - selenium-webdriver (~> 3.142) - simplecov (~> 0.19.0) - simplecov-cobertura (~> 1.3.1) - system_test_html_screenshots (~> 0.2) + rubocop (~> 1.28.0) + rubocop-rails (~> 2.14) + rubocop-rspec (~> 2.10) + selenium-webdriver (~> 4.1.0) + simplecov (~> 0.21.0) + simplecov-cobertura (~> 2.1.0) w3c_rspec_validators (~> 0.3.0) webmock (~> 3.6) wisper-rspec (~> 1.0) - decidim-forms (0.26.5) - decidim-core (= 0.26.5) + decidim-forms (0.27.4) + decidim-core (= 0.27.4) wicked_pdf (~> 2.1) wkhtmltopdf-binary (~> 0.12) - decidim-generators (0.26.5) - decidim-core (= 0.26.5) - decidim-meetings (0.26.5) - decidim-core (= 0.26.5) - decidim-forms (= 0.26.5) + decidim-generators (0.27.4) + decidim-core (= 0.27.4) + decidim-meetings (0.27.4) + decidim-core (= 0.27.4) + decidim-forms (= 0.27.4) icalendar (~> 2.5) - decidim-pages (0.26.5) - decidim-core (= 0.26.5) - decidim-participatory_processes (0.26.5) - decidim-core (= 0.26.5) - decidim-proposals (0.26.5) - decidim-comments (= 0.26.5) - decidim-core (= 0.26.5) - doc2text (~> 0.4.4) + decidim-pages (0.27.4) + decidim-core (= 0.27.4) + decidim-participatory_processes (0.27.4) + decidim-core (= 0.27.4) + decidim-proposals (0.27.4) + decidim-comments (= 0.27.4) + decidim-core (= 0.27.4) + doc2text (~> 0.4.5) redcarpet (~> 3.5, >= 3.5.1) - decidim-sortitions (0.26.5) - decidim-admin (= 0.26.5) - decidim-comments (= 0.26.5) - decidim-core (= 0.26.5) - decidim-proposals (= 0.26.5) - decidim-surveys (0.26.5) - decidim-core (= 0.26.5) - decidim-forms (= 0.26.5) - decidim-templates (= 0.26.5) - decidim-system (0.26.5) + decidim-sortitions (0.27.4) + decidim-admin (= 0.27.4) + decidim-comments (= 0.27.4) + decidim-core (= 0.27.4) + decidim-proposals (= 0.27.4) + decidim-surveys (0.27.4) + decidim-core (= 0.27.4) + decidim-forms (= 0.27.4) + decidim-templates (= 0.27.4) + decidim-system (0.27.4) active_link_to (~> 1.0) - decidim-core (= 0.26.5) + decidim-core (= 0.27.4) devise (~> 4.7) devise-i18n (~> 1.2) devise_invitable (~> 2.0) - decidim-templates (0.26.5) - decidim-core (= 0.26.5) - decidim-forms (= 0.26.5) - decidim-verifications (0.26.5) - decidim-core (= 0.26.5) + decidim-templates (0.27.4) + decidim-core (= 0.27.4) + decidim-forms (= 0.27.4) + decidim-verifications (0.27.4) + decidim-core (= 0.27.4) declarative-builder (0.1.0) declarative-option (< 0.2.0) declarative-option (0.1.0) @@ -343,28 +349,27 @@ GEM rainbow (>= 2.1.0) descendants_tracker (0.0.4) thread_safe (~> 0.3, >= 0.3.1) - devise (4.8.1) + devise (4.9.2) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) responders warden (~> 1.2.3) - devise-i18n (1.10.2) - devise (>= 4.8.0) - devise_invitable (2.0.6) + devise-i18n (1.11.0) + devise (>= 4.9.0) + devise_invitable (2.0.8) actionmailer (>= 5.0) devise (>= 4.6) diff-lcs (1.5.0) diffy (3.4.2) - doc2text (0.4.5) - nokogiri (>= 1.13.2, < 1.14.0) + doc2text (0.4.6) + nokogiri (>= 1.13.2, < 1.15.0) rubyzip (~> 2.3.0) docile (1.4.0) - doorkeeper (5.6.0) + doorkeeper (5.6.6) railties (>= 5) doorkeeper-i18n (4.0.1) dumb_delegator (1.0.0) - equalizer (0.0.11) erb_lint (0.0.37) activesupport better_html (~> 1.0.7) @@ -375,9 +380,12 @@ GEM smart_properties erbse (0.1.4) temple - erubi (1.11.0) - excon (0.93.1) - execjs (2.8.1) + erubi (1.12.0) + escape_utils (1.3.0) + excon (0.103.0) + execjs (2.9.1) + extended-markdown-filter (0.7.0) + html-pipeline (~> 2.9) factory_bot (4.11.1) activesupport (>= 3.0.0) factory_bot_rails (4.11.1) @@ -385,12 +393,13 @@ GEM railties (>= 3.0.0) faker (2.23.0) i18n (>= 1.8.11, < 2) - faraday (2.6.0) + faraday (2.7.11) + base64 faraday-net_http (>= 2.0, < 3.1) ruby2_keywords (>= 0.0.4) - faraday-net_http (3.0.1) + faraday-net_http (3.0.2) ffi (1.15.5) - file_validators (2.3.0) + file_validators (3.0.0) activemodel (>= 3.2) mime-types (>= 1.0) fog-core (2.3.0) @@ -406,21 +415,34 @@ GEM activemodel (>= 4.1, < 7.1) activesupport (>= 4.1, < 7.1) railties (>= 4.1, < 7.1) - geocoder (1.7.5) - globalid (1.0.0) - activesupport (>= 5.0) + gemoji (3.0.1) + geocoder (1.8.2) + globalid (1.2.1) + activesupport (>= 6.1) graphql (1.12.24) + graphql-docs (2.1.0) + commonmarker (~> 0.16) + escape_utils (~> 1.2) + extended-markdown-filter (~> 0.4) + gemoji (~> 3.0) + graphql (~> 1.12) + html-pipeline (~> 2.9) + sass (~> 3.4) gyoku (1.4.0) builder (>= 2.1.2) rexml (~> 3.0) hashdiff (1.0.1) hashie (5.0.0) highline (2.1.0) + hkdf (0.3.0) + html-pipeline (2.14.3) + activesupport (>= 2) + nokogiri (>= 1.4) html_tokenizer (0.0.7) htmlentities (4.3.4) httpi (3.0.1) rack - i18n (1.12.0) + i18n (1.14.1) concurrent-ruby (~> 1.0) i18n-tasks (0.9.37) activesupport (>= 4.0.2) @@ -432,7 +454,7 @@ GEM rails-i18n rainbow (>= 2.2.2, < 4.0) terminal-table (>= 1.5.1) - icalendar (2.8.0) + icalendar (2.9.0) ice_cube (~> 0.16) ice_cube (0.16.4) ice_nine (0.11.2) @@ -471,11 +493,14 @@ GEM listen (3.7.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - loofah (2.3.1) + loofah (2.19.1) crass (~> 1.0.2) nokogiri (>= 1.5.9) - mail (2.7.1) + mail (2.8.1) mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp marcel (1.0.2) matrix (0.4.2) mdl (0.12.0) @@ -485,12 +510,12 @@ GEM mixlib-config (>= 2.2.1, < 4) mixlib-shellout method_source (1.0.0) - mime-types (3.4.1) + mime-types (3.5.1) mime-types-data (~> 3.2015) - mime-types-data (3.2022.0105) - mini_magick (4.11.0) - mini_mime (1.1.2) - minitest (5.16.3) + mime-types-data (3.2023.0808) + mini_magick (4.12.0) + mini_mime (1.1.5) + minitest (5.20.0) mixlib-cli (2.1.8) mixlib-config (3.0.27) tomlrb @@ -499,12 +524,21 @@ GEM msgpack (1.6.0) multi_xml (0.6.0) mustache (1.1.1) - nio4r (2.5.8) - nokogiri (1.13.9-arm64-darwin) + net-imap (0.3.7) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.1) + timeout + net-smtp (0.4.0) + net-protocol + nio4r (2.5.9) + nokogiri (1.14.5-arm64-darwin) racc (~> 1.4) - nokogiri (1.13.9-x86_64-darwin) + nokogiri (1.14.5-x86_64-darwin) racc (~> 1.4) - nokogiri (1.13.9-x86_64-linux) + nokogiri (1.14.5-x86_64-linux) racc (~> 1.4) nori (2.6.0) oauth (1.1.0) @@ -520,7 +554,7 @@ GEM rack (>= 1.2, < 4) snaky_hash (~> 2.0) version_gem (~> 1.1) - omniauth (2.1.0) + omniauth (2.1.1) hashie (>= 3.4.6) rack (>= 2.2.3) rack-protection @@ -548,6 +582,8 @@ GEM activerecord (>= 5.2) request_store (~> 1.1) parallel (1.22.1) + parallel_tests (3.13.0) + parallel parser (3.1.2.1) ast (~> 2.4.1) pg (1.1.4) @@ -555,61 +591,63 @@ GEM activerecord (>= 5.2) activesupport (>= 5.2) polyglot (0.3.5) - premailer (1.18.0) + premailer (1.21.0) addressable css_parser (>= 1.12.0) htmlentities (>= 4.0.0) - premailer-rails (1.11.1) + premailer-rails (1.12.0) actionmailer (>= 3) + net-smtp premailer (~> 1.7, >= 1.7.9) - public_suffix (5.0.0) - puma (5.6.5) + public_suffix (5.0.3) + puma (5.6.7) nio4r (~> 2.0) - racc (1.6.0) - rack (2.2.4) - rack-attack (6.6.1) - rack (>= 1.0, < 3) + racc (1.7.1) + rack (2.2.8) + rack-attack (6.7.0) + rack (>= 1.0, < 4) rack-cors (1.1.1) rack (>= 2.0.0) - rack-protection (3.0.2) - rack - rack-proxy (0.7.4) + rack-protection (3.1.0) + rack (~> 2.2, >= 2.2.4) + rack-proxy (0.7.7) rack - rack-test (2.0.2) + rack-test (2.1.0) rack (>= 1.3) - rails (6.0.6) - actioncable (= 6.0.6) - actionmailbox (= 6.0.6) - actionmailer (= 6.0.6) - actionpack (= 6.0.6) - actiontext (= 6.0.6) - actionview (= 6.0.6) - activejob (= 6.0.6) - activemodel (= 6.0.6) - activerecord (= 6.0.6) - activestorage (= 6.0.6) - activesupport (= 6.0.6) - bundler (>= 1.3.0) - railties (= 6.0.6) + rails (6.1.7.6) + actioncable (= 6.1.7.6) + actionmailbox (= 6.1.7.6) + actionmailer (= 6.1.7.6) + actionpack (= 6.1.7.6) + actiontext (= 6.1.7.6) + actionview (= 6.1.7.6) + activejob (= 6.1.7.6) + activemodel (= 6.1.7.6) + activerecord (= 6.1.7.6) + activestorage (= 6.1.7.6) + activesupport (= 6.1.7.6) + bundler (>= 1.15.0) + railties (= 6.1.7.6) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) activesupport (>= 5.0.1.rc1) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.4.3) - loofah (~> 2.3) + rails-html-sanitizer (1.5.0) + loofah (~> 2.19, >= 2.19.1) rails-i18n (6.0.0) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 7) - railties (6.0.6) - actionpack (= 6.0.6) - activesupport (= 6.0.6) + railties (6.1.7.6) + actionpack (= 6.1.7.6) + activesupport (= 6.1.7.6) method_source - rake (>= 0.8.7) - thor (>= 0.20.3, < 2.0) + rake (>= 12.2) + thor (~> 1.0) rainbow (3.1.1) rake (13.0.6) ransack (2.4.2) @@ -619,20 +657,14 @@ GEM rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) - rectify (0.13.0) - activemodel (>= 4.1.0) - activerecord (>= 4.1.0) - activesupport (>= 4.1.0) - virtus (~> 1.0.5) - wisper (>= 1.6.1) - redcarpet (3.5.1) - redis (4.8.0) + redcarpet (3.6.0) + redis (4.8.1) regexp_parser (2.6.0) request_store (1.5.1) rack (>= 1.4) - responders (3.0.1) - actionpack (>= 5.0) - railties (>= 5.0) + responders (3.1.0) + actionpack (>= 5.2) + railties (>= 5.2) rexml (3.2.5) rspec (3.12.0) rspec-core (~> 3.12.0) @@ -641,15 +673,15 @@ GEM rspec-cells (0.3.8) cells (>= 4.0.0, < 6.0.0) rspec-rails (>= 3.0.0, < 6.1.0) - rspec-core (3.12.1) + rspec-core (3.12.2) rspec-support (~> 3.12.0) - rspec-expectations (3.12.2) + rspec-expectations (3.12.3) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) rspec-html-matchers (0.9.4) nokogiri (~> 1) rspec (>= 3.0.0.a, < 4) - rspec-mocks (3.12.4) + rspec-mocks (3.12.6) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) rspec-rails (4.1.2) @@ -662,29 +694,29 @@ GEM rspec-support (~> 3.10) rspec-retry (0.6.2) rspec-core (> 3.3) - rspec-support (3.12.0) + rspec-support (3.12.1) rspec_junit_formatter (0.3.0) rspec-core (>= 2, < 4, != 2.12.0) - rubocop (0.92.0) + rubocop (1.28.2) parallel (~> 1.10) - parser (>= 2.7.1.5) + parser (>= 3.1.0.0) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.7) + regexp_parser (>= 1.8, < 3.0) rexml - rubocop-ast (>= 0.5.0) + rubocop-ast (>= 1.17.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 2.0) + unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.23.0) parser (>= 3.1.1.0) rubocop-faker (1.1.0) faker (>= 2.12.0) rubocop (>= 0.82.0) - rubocop-rails (2.9.1) + rubocop-rails (2.15.2) activesupport (>= 4.2.0) rack (>= 1.1) - rubocop (>= 0.90.0, < 2.0) - rubocop-rspec (1.43.2) - rubocop (~> 0.87) + rubocop (>= 1.7.0, < 2.0) + rubocop-rspec (2.11.1) + rubocop (~> 1.19) ruby-progressbar (1.11.0) ruby-vips (2.1.4) ffi (~> 1.12) @@ -693,6 +725,11 @@ GEM nokogiri (>= 1.10.8) rubyzip (>= 1.3.0) rubyzip (2.3.2) + sass (3.7.4) + sass-listen (~> 4.0.0) + sass-listen (4.0.0) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) savon (2.13.1) akami (~> 1.2) builder (>= 2.1.2) @@ -702,20 +739,23 @@ GEM nokogiri (>= 1.8.1) nori (~> 2.4) wasabi (~> 3.4) - searchlight (4.1.0) - selenium-webdriver (3.142.7) - childprocess (>= 0.5, < 4.0) + selenium-webdriver (4.1.0) + childprocess (>= 0.5, < 5.0) + rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2) semantic_range (3.0.0) seven_zip_ruby (1.3.0) shoulda-matchers (5.2.0) activesupport (>= 5.2.0) - simplecov (0.19.1) + simplecov (0.21.2) docile (~> 1.1) simplecov-html (~> 0.11) - simplecov-cobertura (1.3.1) - simplecov (~> 0.8) + simplecov_json_formatter (~> 0.1) + simplecov-cobertura (2.1.0) + rexml + simplecov (~> 0.19) simplecov-html (0.12.3) + simplecov_json_formatter (0.1.4) smart_properties (1.17.0) snaky_hash (2.0.1) hashie @@ -726,40 +766,38 @@ GEM spring-watcher-listen (2.0.1) listen (>= 2.7, < 4.0) spring (>= 1.2, < 3.0) - sprockets (4.1.1) + sprockets (4.2.1) concurrent-ruby (~> 1.0) - rack (> 1, < 3) + rack (>= 2.2.4, < 4) sprockets-rails (3.4.2) actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) - ssrf_filter (1.1.1) - system_test_html_screenshots (0.2.0) - actionpack (>= 5.2, < 6.1.a) - temple (0.9.1) + ssrf_filter (1.1.2) + temple (0.10.2) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) - thor (1.2.1) + thor (1.2.2) thread_safe (0.3.6) - tilt (2.0.11) + tilt (2.3.0) + timeout (0.4.0) tomlrb (2.0.3) twilio-ruby (5.73.1) faraday (>= 0.9, < 3.0) jwt (>= 1.5, <= 2.5) nokogiri (>= 1.6, < 2.0) - tzinfo (1.2.10) - thread_safe (~> 0.1) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) uber (0.1.0) unicode-display_width (1.8.0) valid_email2 (2.3.1) activemodel (>= 3.2) mail (~> 2.5) - version_gem (1.1.1) - virtus (1.0.5) + version_gem (1.1.3) + virtus (2.0.0) axiom-types (~> 0.1) coercible (~> 1.0) descendants_tracker (~> 0.0, >= 0.0.3) - equalizer (~> 0.0, >= 0.0.9) w3c_rspec_validators (0.3.0) rails rspec @@ -779,7 +817,7 @@ GEM activemodel (>= 5.0) bindex (>= 0.4.0) railties (>= 5.0) - webmock (3.18.1) + webmock (3.19.1) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) @@ -788,31 +826,35 @@ GEM rack-proxy (>= 0.6.1) railties (>= 5.2) semantic_range (>= 2.3.0) - websocket-driver (0.7.5) + webpush (1.1.0) + hkdf (~> 0.2) + jwt (~> 2.0) + websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - wicked_pdf (2.6.3) + wicked_pdf (2.7.0) activesupport wisper (2.0.1) wisper-rspec (1.1.0) wkhtmltopdf-binary (0.12.6.6) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.4) + zeitwerk (2.6.11) PLATFORMS arm64-darwin-22 x86_64-darwin-22 + x86_64-darwin-23 x86_64-linux DEPENDENCIES bootsnap (~> 1.4) byebug (~> 11.0) codecov - decidim (= 0.26.5) + decidim (= 0.27.4) decidim-action_delegator! - decidim-consultations (= 0.26.5) - decidim-dev (= 0.26.5) + decidim-consultations (= 0.27.4) + decidim-dev (= 0.27.4) faker (~> 2.14) letter_opener_web (~> 2.0) listen (~> 3.1) @@ -825,7 +867,7 @@ DEPENDENCIES web-console RUBY VERSION - ruby 2.7.7p221 + ruby 3.0.6p216 BUNDLED WITH - 2.4.6 + 2.3.24 diff --git a/app/commands/decidim/action_delegator/admin/create_delegation.rb b/app/commands/decidim/action_delegator/admin/create_delegation.rb index ebb7340d..d31b62f0 100644 --- a/app/commands/decidim/action_delegator/admin/create_delegation.rb +++ b/app/commands/decidim/action_delegator/admin/create_delegation.rb @@ -3,7 +3,7 @@ module Decidim module ActionDelegator module Admin - class CreateDelegation < Rectify::Command + class CreateDelegation < Decidim::Command # Public: Initializes the command. # # form - A form object with the params. diff --git a/app/commands/decidim/action_delegator/admin/create_participant.rb b/app/commands/decidim/action_delegator/admin/create_participant.rb index b6c523ae..1b97f427 100644 --- a/app/commands/decidim/action_delegator/admin/create_participant.rb +++ b/app/commands/decidim/action_delegator/admin/create_participant.rb @@ -3,7 +3,7 @@ module Decidim module ActionDelegator module Admin - class CreateParticipant < Rectify::Command + class CreateParticipant < Decidim::Command # Public: Initializes the command. # # form - A form object with the params. diff --git a/app/commands/decidim/action_delegator/admin/create_ponderation.rb b/app/commands/decidim/action_delegator/admin/create_ponderation.rb index 0320fa7d..178337cb 100644 --- a/app/commands/decidim/action_delegator/admin/create_ponderation.rb +++ b/app/commands/decidim/action_delegator/admin/create_ponderation.rb @@ -3,7 +3,7 @@ module Decidim module ActionDelegator module Admin - class CreatePonderation < Rectify::Command + class CreatePonderation < Decidim::Command # Public: Initializes the command. # # form - A form object with the params. diff --git a/app/commands/decidim/action_delegator/admin/create_setting.rb b/app/commands/decidim/action_delegator/admin/create_setting.rb index 3a0b25f0..a8be0670 100644 --- a/app/commands/decidim/action_delegator/admin/create_setting.rb +++ b/app/commands/decidim/action_delegator/admin/create_setting.rb @@ -3,7 +3,7 @@ module Decidim module ActionDelegator module Admin - class CreateSetting < Rectify::Command + class CreateSetting < Decidim::Command # Public: Initializes the command. # # form - A form object with the params. diff --git a/app/commands/decidim/action_delegator/admin/fix_resource_permissions.rb b/app/commands/decidim/action_delegator/admin/fix_resource_permissions.rb index ffbaee87..12be21bc 100644 --- a/app/commands/decidim/action_delegator/admin/fix_resource_permissions.rb +++ b/app/commands/decidim/action_delegator/admin/fix_resource_permissions.rb @@ -3,7 +3,7 @@ module Decidim module ActionDelegator module Admin - class FixResourcePermissions < Rectify::Command + class FixResourcePermissions < Decidim::Command def initialize(resources) @resources = resources @errors = [] diff --git a/app/commands/decidim/action_delegator/admin/update_participant.rb b/app/commands/decidim/action_delegator/admin/update_participant.rb index d567862d..c4527f9a 100644 --- a/app/commands/decidim/action_delegator/admin/update_participant.rb +++ b/app/commands/decidim/action_delegator/admin/update_participant.rb @@ -3,7 +3,7 @@ module Decidim module ActionDelegator module Admin - class UpdateParticipant < Rectify::Command + class UpdateParticipant < Decidim::Command # Public: Initializes the command. # # form - A form object with the params. diff --git a/app/commands/decidim/action_delegator/admin/update_ponderation.rb b/app/commands/decidim/action_delegator/admin/update_ponderation.rb index 47c94dbc..627cab9f 100644 --- a/app/commands/decidim/action_delegator/admin/update_ponderation.rb +++ b/app/commands/decidim/action_delegator/admin/update_ponderation.rb @@ -3,7 +3,7 @@ module Decidim module ActionDelegator module Admin - class UpdatePonderation < Rectify::Command + class UpdatePonderation < Decidim::Command # Public: Initializes the command. # # form - A form object with the params. diff --git a/app/commands/decidim/action_delegator/admin/update_setting.rb b/app/commands/decidim/action_delegator/admin/update_setting.rb index de0ae437..7fbea2e6 100644 --- a/app/commands/decidim/action_delegator/admin/update_setting.rb +++ b/app/commands/decidim/action_delegator/admin/update_setting.rb @@ -3,7 +3,7 @@ module Decidim module ActionDelegator module Admin - class UpdateSetting < Rectify::Command + class UpdateSetting < Decidim::Command # Public: Initializes the command. # # form - A form object with the params. diff --git a/app/controllers/concerns/decidim/action_delegator/devise/sessions_controller_override.rb b/app/controllers/concerns/decidim/action_delegator/devise/sessions_controller_override.rb index 809cc4e4..4bf62b9e 100644 --- a/app/controllers/concerns/decidim/action_delegator/devise/sessions_controller_override.rb +++ b/app/controllers/concerns/decidim/action_delegator/devise/sessions_controller_override.rb @@ -39,8 +39,6 @@ def authorize_user_with_delegations_verifier(user) flash[:notice] = t("authorizations.update.success", scope: "decidim.verifications.sms") return true end - on(:invalid) do - end end end end diff --git a/app/controllers/decidim/action_delegator/admin/manage_participants_controller.rb b/app/controllers/decidim/action_delegator/admin/manage_participants_controller.rb index fbc60ff8..53858969 100644 --- a/app/controllers/decidim/action_delegator/admin/manage_participants_controller.rb +++ b/app/controllers/decidim/action_delegator/admin/manage_participants_controller.rb @@ -34,7 +34,7 @@ def create end def destroy_all - enforce_permission_to :destroy, :participant, resource: current_setting + enforce_permission_to :destroy, :participant, { resource: current_setting } participants_to_remove = current_setting.participants.reject(&:voted?) diff --git a/app/controllers/decidim/action_delegator/admin/settings_controller.rb b/app/controllers/decidim/action_delegator/admin/settings_controller.rb index c62789fe..dfe521c4 100644 --- a/app/controllers/decidim/action_delegator/admin/settings_controller.rb +++ b/app/controllers/decidim/action_delegator/admin/settings_controller.rb @@ -98,7 +98,7 @@ def collection end def settings_select_options - collection.map { |setting| [setting.consultation.id, translated_attribute(setting.title)] }.to_h + collection.to_h { |setting| [setting.consultation.id, translated_attribute(setting.title)] } end def copy_from_setting diff --git a/app/jobs/decidim/action_delegator/send_sms_job.rb b/app/jobs/decidim/action_delegator/send_sms_job.rb index 2116d101..9451453e 100644 --- a/app/jobs/decidim/action_delegator/send_sms_job.rb +++ b/app/jobs/decidim/action_delegator/send_sms_job.rb @@ -5,6 +5,7 @@ module Decidim module ActionDelegator class SendSmsJobException < StandardError; end + class SendSmsJob < ApplicationJob queue_as :default diff --git a/app/models/decidim/action_delegator/participant.rb b/app/models/decidim/action_delegator/participant.rb index 2cca136c..a5648413 100644 --- a/app/models/decidim/action_delegator/participant.rb +++ b/app/models/decidim/action_delegator/participant.rb @@ -85,15 +85,11 @@ def ponderation_title def voted? return false if user.blank? - @voted ||= if Decidim::Consultations::Vote - .joins(question: :consultation) - .where(decidim_consultations_questions: { - decidim_consultation_id: setting.consultation.id - }, author: user).any? - true - else - false - end + @voted ||= Decidim::Consultations::Vote + .joins(question: :consultation) + .where(decidim_consultations_questions: { + decidim_consultation_id: setting.consultation.id + }, author: user).any? end private diff --git a/app/queries/decidim/action_delegator/consultation_delegations.rb b/app/queries/decidim/action_delegator/consultation_delegations.rb index 48147ac8..e9f4c0c4 100644 --- a/app/queries/decidim/action_delegator/consultation_delegations.rb +++ b/app/queries/decidim/action_delegator/consultation_delegations.rb @@ -2,7 +2,7 @@ module Decidim module ActionDelegator - class ConsultationDelegations < Rectify::Query + class ConsultationDelegations < Decidim::Query def self.for(consultation) new(consultation).query end diff --git a/app/queries/decidim/action_delegator/delegates_votes_by_consultation.rb b/app/queries/decidim/action_delegator/delegates_votes_by_consultation.rb index 20ec7c2c..48cf6706 100644 --- a/app/queries/decidim/action_delegator/delegates_votes_by_consultation.rb +++ b/app/queries/decidim/action_delegator/delegates_votes_by_consultation.rb @@ -2,7 +2,7 @@ module Decidim module ActionDelegator - class DelegatesVotesByConsultation < Rectify::Query + class DelegatesVotesByConsultation < Decidim::Query def initialize(consultation, relation = DelegationVotes) @consultation = consultation @relation = relation diff --git a/app/queries/decidim/action_delegator/delegates_votes_by_question.rb b/app/queries/decidim/action_delegator/delegates_votes_by_question.rb index 46aea17f..f9647f7e 100644 --- a/app/queries/decidim/action_delegator/delegates_votes_by_question.rb +++ b/app/queries/decidim/action_delegator/delegates_votes_by_question.rb @@ -2,7 +2,7 @@ module Decidim module ActionDelegator - class DelegatesVotesByQuestion < Rectify::Query + class DelegatesVotesByQuestion < Decidim::Query def initialize(question) @question = question end diff --git a/app/queries/decidim/action_delegator/delegation_votes.rb b/app/queries/decidim/action_delegator/delegation_votes.rb index 0dc8b09a..6e0ea7db 100644 --- a/app/queries/decidim/action_delegator/delegation_votes.rb +++ b/app/queries/decidim/action_delegator/delegation_votes.rb @@ -5,7 +5,7 @@ module ActionDelegator # This query object replaces the ActiveRecord association we would have between the Vote and # Delegation models. Unfortunately we can't use custom foreign keys on both ends of the # association so this aims to replace `delegation.votes`. - class DelegationVotes < Rectify::Query + class DelegationVotes < Decidim::Query def query Delegation.joins( delegations.join(votes).on(vote_author_eq_granter).join_sources diff --git a/app/queries/decidim/action_delegator/organization_delegations.rb b/app/queries/decidim/action_delegator/organization_delegations.rb index 1abd54e2..331213aa 100644 --- a/app/queries/decidim/action_delegator/organization_delegations.rb +++ b/app/queries/decidim/action_delegator/organization_delegations.rb @@ -2,7 +2,7 @@ module Decidim module ActionDelegator - class OrganizationDelegations < Rectify::Query + class OrganizationDelegations < Decidim::Query def initialize(organization) @organization = organization end diff --git a/app/queries/decidim/action_delegator/organization_settings.rb b/app/queries/decidim/action_delegator/organization_settings.rb index 49bc5c7d..23742ba9 100644 --- a/app/queries/decidim/action_delegator/organization_settings.rb +++ b/app/queries/decidim/action_delegator/organization_settings.rb @@ -2,7 +2,7 @@ module Decidim module ActionDelegator - class OrganizationSettings < Rectify::Query + class OrganizationSettings < Decidim::Query def initialize(organization) @organization = organization end diff --git a/app/queries/decidim/action_delegator/responses.rb b/app/queries/decidim/action_delegator/responses.rb index 61f833d0..d8b7b6d1 100644 --- a/app/queries/decidim/action_delegator/responses.rb +++ b/app/queries/decidim/action_delegator/responses.rb @@ -2,7 +2,7 @@ module Decidim module ActionDelegator - class Responses < Rectify::Query + class Responses < Decidim::Query def initialize(consultation) @consultation = consultation end diff --git a/app/queries/decidim/action_delegator/responses_by_membership.rb b/app/queries/decidim/action_delegator/responses_by_membership.rb index 7a7c9280..283be533 100644 --- a/app/queries/decidim/action_delegator/responses_by_membership.rb +++ b/app/queries/decidim/action_delegator/responses_by_membership.rb @@ -3,7 +3,7 @@ module Decidim module ActionDelegator # Returns total votes of each response by memberships' type and weight. - class ResponsesByMembership < Rectify::Query + class ResponsesByMembership < Decidim::Query DEFAULT_METADATA = I18n.t("decidim.admin.consultations.results.default_metadata") def initialize(relation) diff --git a/app/queries/decidim/action_delegator/setting_delegations.rb b/app/queries/decidim/action_delegator/setting_delegations.rb index 23165ff1..f28fe756 100644 --- a/app/queries/decidim/action_delegator/setting_delegations.rb +++ b/app/queries/decidim/action_delegator/setting_delegations.rb @@ -2,7 +2,7 @@ module Decidim module ActionDelegator - class SettingDelegations < Rectify::Query + class SettingDelegations < Decidim::Query def initialize(setting) @setting = setting end diff --git a/app/queries/decidim/action_delegator/sum_of_membership_weight.rb b/app/queries/decidim/action_delegator/sum_of_membership_weight.rb index 349d63c3..f56f0fad 100644 --- a/app/queries/decidim/action_delegator/sum_of_membership_weight.rb +++ b/app/queries/decidim/action_delegator/sum_of_membership_weight.rb @@ -2,7 +2,7 @@ module Decidim module ActionDelegator - class SumOfMembershipWeight < Rectify::Query + class SumOfMembershipWeight < Decidim::Query def initialize(relation) @relation = relation end diff --git a/app/queries/decidim/action_delegator/sum_of_weights.rb b/app/queries/decidim/action_delegator/sum_of_weights.rb index 7a5dc8b1..433dc0a5 100644 --- a/app/queries/decidim/action_delegator/sum_of_weights.rb +++ b/app/queries/decidim/action_delegator/sum_of_weights.rb @@ -2,7 +2,7 @@ module Decidim module ActionDelegator - class SumOfWeights < Rectify::Query + class SumOfWeights < Decidim::Query def initialize(consultation) @consultation = consultation end diff --git a/app/queries/decidim/action_delegator/type_and_weight.rb b/app/queries/decidim/action_delegator/type_and_weight.rb index 0ef5c7aa..f5db41b9 100644 --- a/app/queries/decidim/action_delegator/type_and_weight.rb +++ b/app/queries/decidim/action_delegator/type_and_weight.rb @@ -2,7 +2,7 @@ module Decidim module ActionDelegator - class TypeAndWeight < Rectify::Query + class TypeAndWeight < Decidim::Query def initialize(consultation) @consultation = consultation end diff --git a/app/queries/decidim/action_delegator/voted_with_ponderations.rb b/app/queries/decidim/action_delegator/voted_with_ponderations.rb index dda51783..67519087 100644 --- a/app/queries/decidim/action_delegator/voted_with_ponderations.rb +++ b/app/queries/decidim/action_delegator/voted_with_ponderations.rb @@ -2,7 +2,7 @@ module Decidim module ActionDelegator - class VotedWithPonderations < Rectify::Query + class VotedWithPonderations < Decidim::Query def initialize(relation) @relation = relation end diff --git a/decidim-action_delegator.gemspec b/decidim-action_delegator.gemspec index b8340611..04e9d08e 100644 --- a/decidim-action_delegator.gemspec +++ b/decidim-action_delegator.gemspec @@ -7,7 +7,7 @@ require "decidim/action_delegator/version" Gem::Specification.new do |s| s.version = Decidim::ActionDelegator::VERSION s.authors = ["Pau Pérez Fabregat", "Ivan Vergés"] - s.email = ["saulopefa@gmail.com", "ivan@pokecode.net"] + s.email = %w(saulopefa@gmail.com ivan@pokecode.net) s.license = "AGPL-3.0" s.homepage = "https://github.com/coopdevs/decidim-module-action_delegator" s.required_ruby_version = ">= 2.7" @@ -26,4 +26,5 @@ Gem::Specification.new do |s| s.add_dependency "twilio-ruby" s.add_development_dependency "decidim-dev", Decidim::ActionDelegator::COMPAT_DECIDIM_VERSION + s.metadata["rubygems_mfa_required"] = "true" end diff --git a/details.csv b/details.csv index 4203d621..e69de29b 100644 --- a/details.csv +++ b/details.csv @@ -1 +0,0 @@ -,,,"Email can't be blank, Phone can't be blank" diff --git a/lib/decidim/action_delegator/verifications/delegations_authorizer.rb b/lib/decidim/action_delegator/verifications/delegations_authorizer.rb index ae3d4a81..0823e72a 100644 --- a/lib/decidim/action_delegator/verifications/delegations_authorizer.rb +++ b/lib/decidim/action_delegator/verifications/delegations_authorizer.rb @@ -71,9 +71,7 @@ def setting end def consultation - @consultation ||= begin - component.participatory_space if component&.participatory_space.is_a?(Decidim::Consultation) - end + @consultation ||= (component.participatory_space if component&.participatory_space.is_a?(Decidim::Consultation)) end def manifest diff --git a/lib/decidim/action_delegator/version.rb b/lib/decidim/action_delegator/version.rb index 50597c86..95edf9f1 100644 --- a/lib/decidim/action_delegator/version.rb +++ b/lib/decidim/action_delegator/version.rb @@ -3,8 +3,8 @@ module Decidim # This holds the decidim-action_delegator version. module ActionDelegator - VERSION = "0.7.2" - DECIDIM_VERSION = "0.26.5" - COMPAT_DECIDIM_VERSION = [">= 0.26.0", "< 0.27"].freeze + VERSION = "0.7.3" + DECIDIM_VERSION = "0.27.4" + COMPAT_DECIDIM_VERSION = [">= 0.27.0", "< 0.28"].freeze end end diff --git a/spec/commands/decidim/action_delegator/admin/create_participant_spec.rb b/spec/commands/decidim/action_delegator/admin/create_participant_spec.rb index 38434292..e092ef84 100644 --- a/spec/commands/decidim/action_delegator/admin/create_participant_spec.rb +++ b/spec/commands/decidim/action_delegator/admin/create_participant_spec.rb @@ -26,7 +26,7 @@ end it "creates a participant" do - expect { subject.call }.to(change { Decidim::ActionDelegator::Participant.count }.by(1)) + expect { subject.call }.to(change(Decidim::ActionDelegator::Participant, :count).by(1)) end context "when the form is invalid" do @@ -37,7 +37,7 @@ end it "doesn't create a participant" do - expect { subject.call }.not_to(change { Decidim::ActionDelegator::Participant.count }) + expect { subject.call }.not_to(change(Decidim::ActionDelegator::Participant, :count)) end end end diff --git a/spec/commands/decidim/action_delegator/admin/create_ponderation_spec.rb b/spec/commands/decidim/action_delegator/admin/create_ponderation_spec.rb index 0234ec38..99328f9f 100644 --- a/spec/commands/decidim/action_delegator/admin/create_ponderation_spec.rb +++ b/spec/commands/decidim/action_delegator/admin/create_ponderation_spec.rb @@ -24,7 +24,7 @@ end it "creates a ponderation" do - expect { subject.call }.to(change { Decidim::ActionDelegator::Ponderation.count }.by(1)) + expect { subject.call }.to(change(Decidim::ActionDelegator::Ponderation, :count).by(1)) end context "when the form is invalid" do @@ -35,7 +35,7 @@ end it "doesn't create a Ponderation" do - expect { subject.call }.not_to(change { Decidim::ActionDelegator::Ponderation.count }) + expect { subject.call }.not_to(change(Decidim::ActionDelegator::Ponderation, :count)) end end end diff --git a/spec/commands/decidim/action_delegator/admin/create_setting_spec.rb b/spec/commands/decidim/action_delegator/admin/create_setting_spec.rb index a9632192..9d6341af 100644 --- a/spec/commands/decidim/action_delegator/admin/create_setting_spec.rb +++ b/spec/commands/decidim/action_delegator/admin/create_setting_spec.rb @@ -25,7 +25,7 @@ end it "creates a setting" do - expect { subject.call }.to(change { Decidim::ActionDelegator::Setting.count }.by(1)) + expect { subject.call }.to(change(Decidim::ActionDelegator::Setting, :count).by(1)) end context "when the form is invalid" do @@ -36,7 +36,7 @@ end it "doesn't create a setting" do - expect { subject.call }.not_to(change { Decidim::ActionDelegator::Setting.count }) + expect { subject.call }.not_to(change(Decidim::ActionDelegator::Setting, :count)) end end @@ -58,15 +58,15 @@ end it "creates a setting" do - expect { subject.call }.to(change { Decidim::ActionDelegator::Setting.count }.by(1)) + expect { subject.call }.to(change(Decidim::ActionDelegator::Setting, :count).by(1)) end it "copies participants" do - expect { subject.call }.to(change { Decidim::ActionDelegator::Participant.count }.by(copy_from_setting.participants.count)) + expect { subject.call }.to(change(Decidim::ActionDelegator::Participant, :count).by(copy_from_setting.participants.count)) end it "copies ponderations" do - expect { subject.call }.to(change { Decidim::ActionDelegator::Ponderation.count }.by(copy_from_setting.ponderations.count)) + expect { subject.call }.to(change(Decidim::ActionDelegator::Ponderation, :count).by(copy_from_setting.ponderations.count)) end end end diff --git a/spec/commands/decidim/consultations/multiple_vote_question_spec.rb b/spec/commands/decidim/consultations/multiple_vote_question_spec.rb index a93e661d..bcf62ea1 100644 --- a/spec/commands/decidim/consultations/multiple_vote_question_spec.rb +++ b/spec/commands/decidim/consultations/multiple_vote_question_spec.rb @@ -5,7 +5,7 @@ module Decidim module Consultations describe MultipleVoteQuestion do - let(:subject) { described_class.new(form, user) } + subject { described_class.new(form, user) } let(:organization) { create :organization } let(:consultation) { create :consultation, organization: organization } diff --git a/spec/commands/decidim/consultations/vote_question_spec.rb b/spec/commands/decidim/consultations/vote_question_spec.rb index 9d9edb7a..3129e152 100644 --- a/spec/commands/decidim/consultations/vote_question_spec.rb +++ b/spec/commands/decidim/consultations/vote_question_spec.rb @@ -5,7 +5,7 @@ module Decidim module Consultations describe VoteQuestion do - let(:subject) { described_class.new(form) } + subject { described_class.new(form) } let(:organization) { create :organization } let(:consultation) { create :consultation, organization: organization } diff --git a/spec/controllers/decidim/action_delegator/admin/delegations_controller_spec.rb b/spec/controllers/decidim/action_delegator/admin/delegations_controller_spec.rb index aec66074..96ca267c 100644 --- a/spec/controllers/decidim/action_delegator/admin/delegations_controller_spec.rb +++ b/spec/controllers/decidim/action_delegator/admin/delegations_controller_spec.rb @@ -22,7 +22,7 @@ module ActionDelegator let!(:delegation) { create(:delegation, setting: setting) } it "authorizes the action" do - expect(controller.allowed_to?(:index, :delegation)).to eq true + expect(controller.allowed_to?(:index, :delegation)).to be true get :index, params: { setting_id: setting.id } end @@ -108,7 +108,7 @@ module ActionDelegator let(:params) { { id: delegation.id, setting_id: setting.id } } it "authorizes the action" do - expect(controller).to receive(:allowed_to?).with(:destroy, :delegation, resource: delegation) + expect(controller).to receive(:allowed_to?).with(:destroy, :delegation, { resource: delegation }) delete :destroy, params: params end diff --git a/spec/controllers/decidim/action_delegator/admin/invite_participants_controller_spec.rb b/spec/controllers/decidim/action_delegator/admin/invite_participants_controller_spec.rb index 71727321..838005c9 100644 --- a/spec/controllers/decidim/action_delegator/admin/invite_participants_controller_spec.rb +++ b/spec/controllers/decidim/action_delegator/admin/invite_participants_controller_spec.rb @@ -39,7 +39,7 @@ module Admin it "invites the user and redirects to the participants page" do post :invite_user, params: params - expect(response).to redirect_to setting_participants_path(setting) + expect(response).to redirect_to "/admin/action_delegator#{setting_participants_path(setting)}" expect(flash[:notice]).to eq(I18n.t("invite_user.success", scope: "decidim.action_delegator.admin.invite_participants")) end end @@ -52,7 +52,7 @@ module Admin it "invites all users and redirects to the participants page" do post :invite_all_users, params: { setting_id: setting.id } - expect(response).to redirect_to setting_participants_path(setting) + expect(response).to redirect_to "/admin/action_delegator#{setting_participants_path(setting)}" expect(flash[:notice]).to eq(I18n.t("invite_all_users.success", scope: "decidim.action_delegator.admin.invite_participants")) end end diff --git a/spec/controllers/decidim/action_delegator/admin/manage_participants_controller_spec.rb b/spec/controllers/decidim/action_delegator/admin/manage_participants_controller_spec.rb index e18b2a46..f71b9393 100644 --- a/spec/controllers/decidim/action_delegator/admin/manage_participants_controller_spec.rb +++ b/spec/controllers/decidim/action_delegator/admin/manage_participants_controller_spec.rb @@ -45,7 +45,7 @@ module Admin end it "authorizes the action" do - expect(controller).to receive(:allowed_to?).with(:destroy, :participant, resource: setting) + expect(controller).to receive(:allowed_to?).with(:destroy, :participant, { resource: setting }) get :destroy_all, params: params end diff --git a/spec/controllers/decidim/action_delegator/admin/participants_controller_spec.rb b/spec/controllers/decidim/action_delegator/admin/participants_controller_spec.rb index a9266678..3516a03a 100644 --- a/spec/controllers/decidim/action_delegator/admin/participants_controller_spec.rb +++ b/spec/controllers/decidim/action_delegator/admin/participants_controller_spec.rb @@ -121,7 +121,7 @@ module ActionDelegator describe "#destroy" do it "authorizes the action" do - expect(controller).to receive(:allowed_to?).with(:destroy, :participant, resource: participant) + expect(controller).to receive(:allowed_to?).with(:destroy, :participant, { resource: participant }) get :destroy, params: edit_params end diff --git a/spec/controllers/decidim/action_delegator/admin/ponderations_controller_spec.rb b/spec/controllers/decidim/action_delegator/admin/ponderations_controller_spec.rb index 6e5a8c9c..1b2fcd86 100644 --- a/spec/controllers/decidim/action_delegator/admin/ponderations_controller_spec.rb +++ b/spec/controllers/decidim/action_delegator/admin/ponderations_controller_spec.rb @@ -121,7 +121,7 @@ module ActionDelegator describe "#destroy" do it "authorizes the action" do - expect(controller).to receive(:allowed_to?).with(:destroy, :ponderation, resource: ponderation) + expect(controller).to receive(:allowed_to?).with(:destroy, :ponderation, { resource: ponderation }) get :destroy, params: edit_params end diff --git a/spec/controllers/decidim/action_delegator/admin/settings_controller_spec.rb b/spec/controllers/decidim/action_delegator/admin/settings_controller_spec.rb index fa2cc592..9afe6cff 100644 --- a/spec/controllers/decidim/action_delegator/admin/settings_controller_spec.rb +++ b/spec/controllers/decidim/action_delegator/admin/settings_controller_spec.rb @@ -61,7 +61,7 @@ module ActionDelegator it "creates new settings" do expect { post :create, params: setting_params }.to change(Setting, :count).by(1) - expect(response).to redirect_to(settings_path) + expect(response).to redirect_to("/admin/action_delegator#{settings_path}") expect(flash[:notice]).to eq(I18n.t("decidim.action_delegator.admin.settings.create.success")) end end @@ -105,7 +105,7 @@ module ActionDelegator expect(setting.reload.max_grants).to eq(3) expect(setting.consultation).to eq(another_consultation) expect(setting.authorization_method).to eq("phone") - expect(response).to redirect_to(settings_path) + expect(response).to redirect_to("/admin/action_delegator#{settings_path}") expect(flash[:notice]).to eq(I18n.t("decidim.action_delegator.admin.settings.update.success")) end end @@ -123,7 +123,7 @@ module ActionDelegator let!(:setting) { create(:setting, consultation: consultation) } it "authorizes the action" do - expect(controller).to receive(:allowed_to?).with(:destroy, :setting, resource: setting) + expect(controller).to receive(:allowed_to?).with(:destroy, :setting, { resource: setting }) delete :destroy, params: { id: setting.id } end diff --git a/spec/i18n_spec.rb b/spec/i18n_spec.rb index 1e67a27e..c74b8ce0 100644 --- a/spec/i18n_spec.rb +++ b/spec/i18n_spec.rb @@ -7,7 +7,7 @@ ENV["ENFORCED_LOCALES"].presence || "en" end - let(:i18n) { I18n::Tasks::BaseTask.new({ locales: locales.split(",") }) } + let(:i18n) { I18n::Tasks::BaseTask.new(locales: locales.split(",")) } let(:missing_keys) { i18n.missing_keys } let(:unused_keys) { i18n.unused_keys } let(:non_normalized_paths) { i18n.non_normalized_paths } diff --git a/spec/jobs/decidim/action_delegator/export_consultation_results_job_spec.rb b/spec/jobs/decidim/action_delegator/export_consultation_results_job_spec.rb index 2115f046..f3d69677 100644 --- a/spec/jobs/decidim/action_delegator/export_consultation_results_job_spec.rb +++ b/spec/jobs/decidim/action_delegator/export_consultation_results_job_spec.rb @@ -87,12 +87,12 @@ module Decidim::ActionDelegator shared_examples "exports consultation" do it "exports consultation's by membership" do expect(Decidim::ExportMailer).to receive(:export) do |_user, _name, export_data| - expect(export_data.read).to eq(<<-CSV.strip_heredoc) - question;response;membership_type;membership_weight;votes_count - question_title;A;consumer;3.0;1 - question_title;A;consumer;1.0;1 - question_title;A;producer;2.0;1 - question_title;B;consumer;1.0;1 + expect(export_data.read).to eq(<<~CSV) + question;response;membership_type;membership_weight;votes_count + question_title;A;consumer;3.0;1 + question_title;A;consumer;1.0;1 + question_title;A;producer;2.0;1 + question_title;B;consumer;1.0;1 CSV end.and_return(mailer) @@ -165,7 +165,7 @@ module Decidim::ActionDelegator it "exports consultation's by membership" do expect(Decidim::ExportMailer).to receive(:export) do |_user, _name, export_data| - expect(export_data.read).to eq(<<-CSV.strip_heredoc) + expect(export_data.read).to eq(<<~CSV) question;response;votes_count question_title;A;6 question_title;B;1 diff --git a/spec/jobs/decidim/action_delegator/twilio_send_sms_job_spec.rb b/spec/jobs/decidim/action_delegator/twilio_send_sms_job_spec.rb index 9ee780ce..7ee0236d 100644 --- a/spec/jobs/decidim/action_delegator/twilio_send_sms_job_spec.rb +++ b/spec/jobs/decidim/action_delegator/twilio_send_sms_job_spec.rb @@ -27,7 +27,7 @@ module Decidim::ActionDelegator end it "creates a message through Twilio's client" do - expect(subject.perform_now(sender, mobile_phone_number, message)).to eq true + expect(subject.perform_now(sender, mobile_phone_number, message)).to be true end end end diff --git a/spec/lib/overrides_spec.rb b/spec/lib/overrides_spec.rb index e7c924af..bbbbe02c 100644 --- a/spec/lib/overrides_spec.rb +++ b/spec/lib/overrides_spec.rb @@ -13,15 +13,15 @@ module Decidim::ActionDelegator # non deface views "/app/views/decidim/consultations/question_votes/update_vote_button.js.erb" => "a675fe780e77e8766beef999112a8fcb", # deface views - "/app/views/decidim/consultations/consultations/_question.html.erb" => "21b19519b1f249c27a536fbd1b49d619", + "/app/views/decidim/consultations/consultations/_question.html.erb" => "2d02835e2a1538cd7f6db698e302a29b", # NOTE: _vote_button.html.erb is copied into _delegations_modal.html.erb, double check that view if _vote_button.html.erb changed - "/app/views/decidim/consultations/questions/_vote_button.html.erb" => "a339b7639e8d36b0699ab3f7763872fb", - "/app/views/decidim/consultations/questions/_vote_modal.html.erb" => "ae7c38afcc6588a00f8298ea69769da7", - "/app/views/decidim/consultations/questions/_vote_modal_confirm.html.erb" => "a0d033ed6593f15c957393afa128ca12", + "/app/views/decidim/consultations/questions/_vote_button.html.erb" => "7f3516e6d13cc4a1a9c0894b9d9fb808", + "/app/views/decidim/consultations/questions/_vote_modal.html.erb" => "bb4b10e9278cffd8d0d4eb57f5197a89", + "/app/views/decidim/consultations/questions/_vote_modal_confirm.html.erb" => "bac38cece8f1eaf76265fa1ad0ace064", "/app/views/decidim/consultations/question_multiple_votes/_form.html.erb" => "af610283ce7ee20f5ef786228a263d4a", # monkeypatches - "/app/commands/decidim/consultations/vote_question.rb" => "8d89031039a1ba2972437d13687a72b5", - "/app/commands/decidim/consultations/multiple_vote_question.rb" => "06d4cde2805031ecbb0c546fad567065", + "/app/commands/decidim/consultations/vote_question.rb" => "bb0489e93d3bd142db19d9f93f556d67", + "/app/commands/decidim/consultations/multiple_vote_question.rb" => "86ac61db829acb4e86a9b6d90bd46333", "/app/models/decidim/consultations/vote.rb" => "c06286e3f7366d3a017bf69f1c9e3eef", "/app/controllers/decidim/consultations/question_votes_controller.rb" => "69bf764e99dfcdae138613adbed28b84", "/app/forms/decidim/consultations/vote_form.rb" => "d2b69f479b61b32faf3b108da310081a", diff --git a/spec/models/decidim/action_delegator/delegation_spec.rb b/spec/models/decidim/action_delegator/delegation_spec.rb index 28efa15a..f22e1c8f 100644 --- a/spec/models/decidim/action_delegator/delegation_spec.rb +++ b/spec/models/decidim/action_delegator/delegation_spec.rb @@ -42,7 +42,7 @@ module ActionDelegator context "when there is no delegation granted to user for the given consultation" do it "returns false" do - expect(described_class.granted_to?(user, consultation)).to eq(false) + expect(described_class.granted_to?(user, consultation)).to be(false) end it_behaves_like "can be destroyed" @@ -52,7 +52,7 @@ module ActionDelegator let!(:delegation) { create(:delegation, setting: setting, grantee: user) } it "returns true" do - expect(described_class.granted_to?(user, consultation)).to eq(true) + expect(described_class.granted_to?(user, consultation)).to be(true) end it_behaves_like "can be destroyed" diff --git a/spec/permissions/decidim/action_delegator/delegation_permissions_spec.rb b/spec/permissions/decidim/action_delegator/delegation_permissions_spec.rb index 0c00e9bc..4e9c30b5 100644 --- a/spec/permissions/decidim/action_delegator/delegation_permissions_spec.rb +++ b/spec/permissions/decidim/action_delegator/delegation_permissions_spec.rb @@ -5,7 +5,7 @@ describe Decidim::ActionDelegator::Permissions do # rubocop:disable RSpec/FilePath subject { described_class.new(user, permission_action, context).permissions.allowed? } - let(:permission_action) { Decidim::PermissionAction.new(action) } + let(:permission_action) { Decidim::PermissionAction.new(**action) } let(:context) { {} } let(:organization) { create(:organization, available_authorizations: ["dummy_authorization_workflow"]) } @@ -34,13 +34,13 @@ end context "and it wasn't voted yet" do - it { is_expected.to eq(true) } + it { is_expected.to be(true) } end context "and it was already voted" do before { create(:vote, author: granter, question: question) } - it { is_expected.to eq(false) } + it { is_expected.to be(false) } end end @@ -56,7 +56,7 @@ Decidim::Authorization.create!(name: "dummy_authorization_workflow", decidim_user_id: other_user.id, granted_at: Time.zone.now) end - it { is_expected.to eq(false) } + it { is_expected.to be(false) } end end @@ -74,13 +74,13 @@ end context "and it was already voted" do - it { is_expected.to eq(true) } + it { is_expected.to be(true) } end context "and it wasn't voted yet" do before { vote.destroy } - it { is_expected.to eq(false) } + it { is_expected.to be(false) } end end @@ -96,7 +96,7 @@ Decidim::Authorization.create!(name: "dummy_authorization_workflow", decidim_user_id: other_user.id, granted_at: Time.zone.now) end - it { is_expected.to eq(false) } + it { is_expected.to be(false) } end end end diff --git a/spec/permissions/decidim/action_delegator/permissions_spec.rb b/spec/permissions/decidim/action_delegator/permissions_spec.rb index ad5fd776..6cbbf2e0 100644 --- a/spec/permissions/decidim/action_delegator/permissions_spec.rb +++ b/spec/permissions/decidim/action_delegator/permissions_spec.rb @@ -6,7 +6,7 @@ subject { described_class.new(user, permission_action, context).permissions.allowed? } let(:user) { build(:user, :admin) } - let(:permission_action) { Decidim::PermissionAction.new(action) } + let(:permission_action) { Decidim::PermissionAction.new(**action) } let(:context) { {} } context "when scope is not admin" do @@ -44,7 +44,7 @@ end context "when the user is admin" do - it { is_expected.to eq(true) } + it { is_expected.to be(true) } end context "when the user is not admin" do @@ -60,7 +60,7 @@ end context "when the user is admin" do - it { is_expected.to eq(true) } + it { is_expected.to be(true) } end context "when the user is not admin" do @@ -77,7 +77,7 @@ let(:context) { { resource: create(:delegation) } } context "when the user is admin" do - it { is_expected.to eq(true) } + it { is_expected.to be(true) } end context "when the user is not admin" do @@ -93,7 +93,7 @@ end context "when the user is admin" do - it { is_expected.to eq(true) } + it { is_expected.to be(true) } end context "when the user is not admin" do @@ -109,7 +109,7 @@ end context "when the user is admin" do - it { is_expected.to eq(true) } + it { is_expected.to be(true) } end context "when the user is not admin" do @@ -126,7 +126,7 @@ let(:context) { { resource: create(:setting) } } context "when the user is admin" do - it { is_expected.to eq(true) } + it { is_expected.to be(true) } end context "when the user is not admin" do diff --git a/spec/queries/decidim/action_delegator/sum_of_membership_weight_spec.rb b/spec/queries/decidim/action_delegator/sum_of_membership_weight_spec.rb index e7fc6f1b..40437ee5 100644 --- a/spec/queries/decidim/action_delegator/sum_of_membership_weight_spec.rb +++ b/spec/queries/decidim/action_delegator/sum_of_membership_weight_spec.rb @@ -49,7 +49,7 @@ module ActionDelegator let!(:participant3) { create(:participant, ponderation: ponderation2, decidim_user: yet_other_user, setting: setting) } it "aggregates their membership weights" do - expect(votes_count).to eq([2 * ponderation1.weight + ponderation2.weight]) + expect(votes_count).to eq([(2 * ponderation1.weight) + ponderation2.weight]) end end diff --git a/spec/serializers/decidim/action_delegator/consultation_results_serializer_spec.rb b/spec/serializers/decidim/action_delegator/consultation_results_serializer_spec.rb index e43f393f..070c90f5 100644 --- a/spec/serializers/decidim/action_delegator/consultation_results_serializer_spec.rb +++ b/spec/serializers/decidim/action_delegator/consultation_results_serializer_spec.rb @@ -4,7 +4,8 @@ module Decidim::ActionDelegator describe ConsultationResultsSerializer do - let(:subject) { described_class.new(result) } + subject { described_class.new(result) } + let(:question) { instance_double(Decidim::Consultations::Question, title: { "ca" => "question_title" }) } let(:result) do double( diff --git a/spec/serializers/decidim/action_delegator/sum_of_weights_serializer_spec.rb b/spec/serializers/decidim/action_delegator/sum_of_weights_serializer_spec.rb index 03df6a02..3e6e052f 100644 --- a/spec/serializers/decidim/action_delegator/sum_of_weights_serializer_spec.rb +++ b/spec/serializers/decidim/action_delegator/sum_of_weights_serializer_spec.rb @@ -4,7 +4,8 @@ module Decidim::ActionDelegator describe SumOfWeightsSerializer do - let(:subject) { described_class.new(result) } + subject { described_class.new(result) } + let(:result) do double( :result, diff --git a/spec/services/decidim/action_delegator/delegations_csv_importer_spec.rb b/spec/services/decidim/action_delegator/delegations_csv_importer_spec.rb index 4ea4378b..2a1aa7e7 100644 --- a/spec/services/decidim/action_delegator/delegations_csv_importer_spec.rb +++ b/spec/services/decidim/action_delegator/delegations_csv_importer_spec.rb @@ -49,7 +49,7 @@ it "creates delegations from valid rows" do expect do subject.import! - end.to change(Decidim::ActionDelegator::Delegation, :count).by(0) + end.not_to change(Decidim::ActionDelegator::Delegation, :count) end it "returns a summary of the import" do @@ -69,7 +69,7 @@ it "does not create a new delegation" do expect do subject.import! - end.to change(Decidim::ActionDelegator::Delegation, :count).by(0) + end.not_to change(Decidim::ActionDelegator::Delegation, :count) end end diff --git a/spec/services/decidim/action_delegator/sms_gateway_spec.rb b/spec/services/decidim/action_delegator/sms_gateway_spec.rb index 81b4fd0e..e0b2c879 100644 --- a/spec/services/decidim/action_delegator/sms_gateway_spec.rb +++ b/spec/services/decidim/action_delegator/sms_gateway_spec.rb @@ -4,7 +4,8 @@ module Decidim::ActionDelegator describe SmsGateway do - let(:subject) { described_class.new(mobile_phone_number, code) } + subject { described_class.new(mobile_phone_number, code) } + let(:mobile_phone_number) { "+12 345 678 901" } let(:code) { "1a4s9b" } let(:response_body) { { send_sms_response: { result: result } } } diff --git a/spec/support/shared_examples/export_controller.rb b/spec/support/shared_examples/export_controller.rb index 36fe710f..570a6209 100644 --- a/spec/support/shared_examples/export_controller.rb +++ b/spec/support/shared_examples/export_controller.rb @@ -3,7 +3,7 @@ RSpec.shared_examples "results export controller" do |type| it "authorizes the action" do expect(controller).to receive(:allowed_to?) - .with(:export_consultation_results, :consultation, consultation: consultation) + .with(:export_consultation_results, :consultation, { consultation: consultation }) post :create, params: { consultation_slug: consultation.slug } end diff --git a/spec/tasks/import_direct_verification_spec.rb b/spec/tasks/import_direct_verification_spec.rb index 96df2906..bc3785b4 100644 --- a/spec/tasks/import_direct_verification_spec.rb +++ b/spec/tasks/import_direct_verification_spec.rb @@ -31,11 +31,11 @@ end it "create participants" do - expect { task.execute }.to change { Decidim::ActionDelegator::Participant.count }.by(5) + expect { task.execute }.to change(Decidim::ActionDelegator::Participant, :count).by(5) end it "create weights" do - expect { task.execute }.to change { Decidim::ActionDelegator::Ponderation.count }.by(4) + expect { task.execute }.to change(Decidim::ActionDelegator::Ponderation, :count).by(4) end context "when no current participants" do @@ -68,11 +68,11 @@ let!(:participant5) { create(:participant, setting: setting2, ponderation: setting2.ponderations.third, email: user5.email) } it "does not change current weights" do - expect { task.execute }.not_to(change { Decidim::ActionDelegator::Ponderation.count }) + expect { task.execute }.not_to(change(Decidim::ActionDelegator::Ponderation, :count)) end it "does not change current participants" do - expect { task.execute }.not_to(change { Decidim::ActionDelegator::Participant.count }) + expect { task.execute }.not_to(change(Decidim::ActionDelegator::Participant, :count)) end context "when using the command" do