diff --git a/.github/workflows/build_app.yml b/.github/workflows/build_app.yml index 35e54a5..f7ca3a7 100644 --- a/.github/workflows/build_app.yml +++ b/.github/workflows/build_app.yml @@ -3,7 +3,7 @@ on: inputs: ruby_version: description: 'Ruby Version' - default: "3.1.1" + default: "3.2.6" type: string required: false node_version: @@ -34,19 +34,19 @@ jobs: env: POSTGRES_PASSWORD: postgres steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 1 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ inputs.ruby_version }} bundler-cache: true - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: ${{ inputs.node_version }} cache: 'npm' cache-dependency-path: ./package-lock.json - - uses: actions/cache@v3 + - uses: actions/cache@v4 id: app-cache with: path: ./spec/decidim_dummy_app/ diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index 20fe405..7745fa8 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -15,7 +15,7 @@ on: env: CI: "true" - RUBY_VERSION: 3.1.1 + RUBY_VERSION: 3.2.6 NODE_VERSION: 18.17.1 concurrency: @@ -33,7 +33,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 60 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 1 - uses: actions/setup-node@master diff --git a/.github/workflows/test_app.yml b/.github/workflows/test_app.yml index 70894d8..1b9e5cf 100644 --- a/.github/workflows/test_app.yml +++ b/.github/workflows/test_app.yml @@ -3,7 +3,7 @@ on: inputs: ruby_version: description: 'Ruby Version' - default: "3.1.1" + default: "3.2.6" required: false type: string test_command: @@ -41,8 +41,15 @@ jobs: --health-retries 5 env: POSTGRES_PASSWORD: postgres + redis: + image: redis + options: >- + --health-cmd "redis-cli ping" + --health-interval 10s + --health-timeout 5s + --health-retries 5 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 1 - uses: ruby/setup-ruby@v1 @@ -59,7 +66,7 @@ jobs: name: Install Chrome version ${{inputs.chrome_version}} with: chromedriver-version: ${{inputs.chrome_version}} - - uses: actions/cache@v3 + - uses: actions/cache@v4 id: app-cache with: path: ./spec/decidim_dummy_app/ diff --git a/.rubocop.yml b/.rubocop.yml index b901a13..e85f6ba 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,4 +1,5 @@ -inherit_from: https://raw.githubusercontent.com/decidim/decidim/release/0.28-stable/.rubocop.yml +inherit_gem: + decidim-dev: rubocop-decidim.yml AllCops: Include: @@ -14,7 +15,3 @@ AllCops: - "node_modules/**/*" - "db/schema.rb" - "vendor/**/*" - -RSpec/FilePath: - Exclude: - - "spec/serializers/user_export_serializer_spec.rb" diff --git a/.ruby-version b/.ruby-version index 94ff29c..34cde56 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.1.1 +3.2.6 diff --git a/Gemfile b/Gemfile index ed3f02d..0ca8b63 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ # frozen_string_literal: true -DECIDIM_VERSION = "~> 0.28" +DECIDIM_VERSION = "~> 0.29.2" source "https://rubygems.org" @@ -9,9 +9,8 @@ ruby RUBY_VERSION gem "decidim", DECIDIM_VERSION gem "decidim-extra_user_fields", path: "." -gem "bootsnap", "~> 1.3" -gem "country_select", "~> 4.0" -gem "puma", ">= 4.3" +gem "bootsnap", "~> 1.7" +gem "puma", ">= 6.3.1" group :development, :test do gem "byebug", "~> 11.0", platform: :mri @@ -23,12 +22,5 @@ group :development do gem "letter_opener_web", "~> 2.0" gem "listen", "~> 3.1" gem "rubocop-faker" - gem "spring", "~> 2.0" - gem "spring-watcher-listen", "~> 2.0" gem "web-console", "~> 4.2" end - -group :test do - gem "rubocop-factory_bot", "!= 2.26.0", require: false - gem "rubocop-rspec_rails", "!= 2.29.0", require: false -end diff --git a/Gemfile.lock b/Gemfile.lock index 1539fe4..8c69f55 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,48 +1,55 @@ PATH remote: . specs: - decidim-extra_user_fields (0.28.0) + decidim-extra_user_fields (0.29.0) country_select (~> 4.0) - decidim-core (>= 0.28) + decidim-core (>= 0.29) deface (~> 1.5) GEM remote: https://rubygems.org/ specs: - actioncable (6.1.7.8) - actionpack (= 6.1.7.8) - activesupport (= 6.1.7.8) + actioncable (7.0.8.7) + actionpack (= 7.0.8.7) + activesupport (= 7.0.8.7) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.1.7.8) - actionpack (= 6.1.7.8) - activejob (= 6.1.7.8) - activerecord (= 6.1.7.8) - activestorage (= 6.1.7.8) - activesupport (= 6.1.7.8) + actionmailbox (7.0.8.7) + actionpack (= 7.0.8.7) + activejob (= 7.0.8.7) + activerecord (= 7.0.8.7) + activestorage (= 7.0.8.7) + activesupport (= 7.0.8.7) mail (>= 2.7.1) - actionmailer (6.1.7.8) - actionpack (= 6.1.7.8) - actionview (= 6.1.7.8) - activejob (= 6.1.7.8) - activesupport (= 6.1.7.8) + net-imap + net-pop + net-smtp + actionmailer (7.0.8.7) + actionpack (= 7.0.8.7) + actionview (= 7.0.8.7) + activejob (= 7.0.8.7) + activesupport (= 7.0.8.7) mail (~> 2.5, >= 2.5.4) + net-imap + net-pop + net-smtp rails-dom-testing (~> 2.0) - actionpack (6.1.7.8) - actionview (= 6.1.7.8) - activesupport (= 6.1.7.8) - rack (~> 2.0, >= 2.0.9) + actionpack (7.0.8.7) + actionview (= 7.0.8.7) + activesupport (= 7.0.8.7) + rack (~> 2.0, >= 2.2.4) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.1.7.8) - actionpack (= 6.1.7.8) - activerecord (= 6.1.7.8) - activestorage (= 6.1.7.8) - activesupport (= 6.1.7.8) + actiontext (7.0.8.7) + actionpack (= 7.0.8.7) + activerecord (= 7.0.8.7) + activestorage (= 7.0.8.7) + activesupport (= 7.0.8.7) + globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (6.1.7.8) - activesupport (= 6.1.7.8) + actionview (7.0.8.7) + activesupport (= 7.0.8.7) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) @@ -50,28 +57,27 @@ GEM active_link_to (1.0.5) actionpack addressable - activejob (6.1.7.8) - activesupport (= 6.1.7.8) + activejob (7.0.8.7) + activesupport (= 7.0.8.7) globalid (>= 0.3.6) - activemodel (6.1.7.8) - activesupport (= 6.1.7.8) - activerecord (6.1.7.8) - activemodel (= 6.1.7.8) - activesupport (= 6.1.7.8) - activestorage (6.1.7.8) - actionpack (= 6.1.7.8) - activejob (= 6.1.7.8) - activerecord (= 6.1.7.8) - activesupport (= 6.1.7.8) + activemodel (7.0.8.7) + activesupport (= 7.0.8.7) + activerecord (7.0.8.7) + activemodel (= 7.0.8.7) + activesupport (= 7.0.8.7) + activestorage (7.0.8.7) + actionpack (= 7.0.8.7) + activejob (= 7.0.8.7) + activerecord (= 7.0.8.7) + activesupport (= 7.0.8.7) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (6.1.7.8) + activesupport (7.0.8.7) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) - zeitwerk (~> 2.3) - acts_as_list (1.2.1) + acts_as_list (1.2.4) activerecord (>= 6.1) activesupport (>= 6.1) addressable (2.8.7) @@ -87,7 +93,7 @@ GEM erubi (~> 1.4) parser (>= 2.4) smart_properties - bigdecimal (3.1.8) + bigdecimal (3.1.9) bindex (0.8.1) bootsnap (1.18.3) msgpack (~> 1.2) @@ -106,30 +112,22 @@ GEM rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) - carrierwave (2.2.6) - activemodel (>= 5.0.0) - activesupport (>= 5.0.0) - addressable (~> 2.6) - image_processing (~> 1.1) - marcel (~> 1.0.0) - mini_mime (>= 0.1.3) - ssrf_filter (~> 1.0) - cells (4.1.7) - declarative-builder (< 0.2.0) + cells (4.1.8) + declarative-builder (~> 0.2.0) declarative-option (< 0.2.0) tilt (>= 1.4, < 3) uber (< 0.2.0) cells-erb (0.1.0) cells (~> 4.0) erbse (>= 0.1.1) - cells-rails (0.1.5) + cells-rails (0.1.6) actionpack (>= 5.0) cells (>= 4.1.6, < 5.0.0) - charlock_holmes (0.7.8) + charlock_holmes (0.7.9) childprocess (5.1.0) logger (~> 1.5) - commonmarker (0.23.10) - concurrent-ruby (1.3.3) + commonmarker (0.23.11) + concurrent-ruby (1.3.4) countries (3.1.0) i18n_data (~> 0.11.0) sixarm_ruby_unaccent (~> 1.1) @@ -141,70 +139,69 @@ GEM bigdecimal rexml crass (1.0.6) - css_parser (1.17.1) + css_parser (1.21.1) addressable - csv (3.3.0) - date (3.3.4) + csv (3.3.3) + dartsass (1.49.8) + date (3.4.1) date_validator (0.12.0) activemodel (>= 3) activesupport (>= 3) - decidim (0.28.1) - decidim-accountability (= 0.28.1) - decidim-admin (= 0.28.1) - decidim-api (= 0.28.1) - decidim-assemblies (= 0.28.1) - decidim-blogs (= 0.28.1) - decidim-budgets (= 0.28.1) - decidim-comments (= 0.28.1) - decidim-core (= 0.28.1) - decidim-debates (= 0.28.1) - decidim-forms (= 0.28.1) - decidim-generators (= 0.28.1) - decidim-meetings (= 0.28.1) - decidim-pages (= 0.28.1) - decidim-participatory_processes (= 0.28.1) - decidim-proposals (= 0.28.1) - decidim-sortitions (= 0.28.1) - decidim-surveys (= 0.28.1) - decidim-system (= 0.28.1) - decidim-templates (= 0.28.1) - decidim-verifications (= 0.28.1) - decidim-accountability (0.28.1) - decidim-comments (= 0.28.1) - decidim-core (= 0.28.1) - decidim-admin (0.28.1) + decidim (0.29.2) + decidim-accountability (= 0.29.2) + decidim-admin (= 0.29.2) + decidim-api (= 0.29.2) + decidim-assemblies (= 0.29.2) + decidim-blogs (= 0.29.2) + decidim-budgets (= 0.29.2) + decidim-comments (= 0.29.2) + decidim-core (= 0.29.2) + decidim-debates (= 0.29.2) + decidim-forms (= 0.29.2) + decidim-generators (= 0.29.2) + decidim-meetings (= 0.29.2) + decidim-pages (= 0.29.2) + decidim-participatory_processes (= 0.29.2) + decidim-proposals (= 0.29.2) + decidim-sortitions (= 0.29.2) + decidim-surveys (= 0.29.2) + decidim-system (= 0.29.2) + decidim-verifications (= 0.29.2) + decidim-accountability (0.29.2) + decidim-comments (= 0.29.2) + decidim-core (= 0.29.2) + decidim-admin (0.29.2) active_link_to (~> 1.0) - decidim-core (= 0.28.1) + decidim-core (= 0.29.2) devise (~> 4.7) devise-i18n (~> 1.2) devise_invitable (~> 2.0, >= 2.0.9) - decidim-api (0.28.1) - commonmarker (~> 0.23.0, >= 0.23.9) - decidim-core (= 0.28.1) - graphql (~> 2.0.0) - graphql-docs (~> 3.0.1) + decidim-api (0.29.2) + decidim-core (= 0.29.2) + graphql (~> 2.2.6) + graphql-docs (~> 4.0) rack-cors (~> 1.0) - decidim-assemblies (0.28.1) - decidim-core (= 0.28.1) - decidim-blogs (0.28.1) - decidim-admin (= 0.28.1) - decidim-comments (= 0.28.1) - decidim-core (= 0.28.1) - decidim-budgets (0.28.1) - decidim-comments (= 0.28.1) - decidim-core (= 0.28.1) - decidim-comments (0.28.1) - decidim-core (= 0.28.1) + decidim-assemblies (0.29.2) + decidim-core (= 0.29.2) + decidim-blogs (0.29.2) + decidim-admin (= 0.29.2) + decidim-comments (= 0.29.2) + decidim-core (= 0.29.2) + decidim-budgets (0.29.2) + decidim-comments (= 0.29.2) + decidim-core (= 0.29.2) + decidim-comments (0.29.2) + decidim-core (= 0.29.2) redcarpet (~> 3.5, >= 3.5.1) - decidim-core (0.28.1) + decidim-core (0.29.2) active_link_to (~> 1.0) acts_as_list (~> 1.0) batch-loader (~> 1.2) browser (~> 2.7) - carrierwave (~> 2.2.5, >= 2.2.5) cells-erb (~> 0.1.0) cells-rails (~> 0.1.3) charlock_holmes (~> 0.7) + concurrent-ruby (= 1.3.4) date_validator (~> 0.12.0) devise (~> 4.7) devise-i18n (~> 1.2, < 1.11.1) @@ -216,12 +213,14 @@ GEM foundation_rails_helper (~> 4.0) geocoder (~> 1.8) hashdiff (>= 0.4.0, < 2.0.0) + image_processing (~> 1.2) invisible_captcha (~> 0.12) kaminari (~> 1.2, >= 1.2.1) loofah (~> 2.19, >= 2.19.1) mime-types (>= 1.16, < 4.0) mini_magick (~> 4.9) net-smtp (~> 0.3.1) + nokogiri (~> 1.16, >= 1.16.2) omniauth (~> 2.0) omniauth-facebook (~> 5.0) omniauth-google-oauth2 (~> 1.0) @@ -232,33 +231,32 @@ GEM pg_search (~> 2.2) premailer-rails (~> 1.10) psych (~> 4.0) - rack (~> 2.2, >= 2.2.6.4) + rack (~> 2.2, >= 2.2.8.1) rack-attack (~> 6.0) - rails (~> 6.1.7, >= 6.1.7.4) - rails-i18n (~> 6.0) + rails (~> 7.0.8) + rails-i18n (~> 7.0) ransack (~> 3.2.1) redis (~> 4.1) request_store (~> 1.5.0) rubyXL (~> 3.4) rubyzip (~> 2.0) - seven_zip_ruby (~> 1.3) shakapacker (~> 7.1.0) valid_email2 (~> 4.0) web-push (~> 3.0) wisper (~> 2.0) - decidim-debates (0.28.1) - decidim-comments (= 0.28.1) - decidim-core (= 0.28.1) - decidim-dev (0.28.1) - bullet (~> 7.0) + decidim-debates (0.29.2) + decidim-comments (= 0.29.2) + decidim-core (= 0.29.2) + decidim-dev (0.29.2) + bullet (~> 7.1.6) byebug (~> 11.0) capybara (~> 3.39) - decidim (= 0.28.1) + decidim (= 0.29.2) erb_lint (~> 0.4.0) factory_bot_rails (~> 6.2) faker (~> 3.2) i18n-tasks (~> 1.0) - nokogiri (~> 1.14, >= 1.14.3) + nokogiri (~> 1.16, >= 1.16.2) parallel_tests (~> 4.2) puma (~> 6.2, >= 6.3.1) rails-controller-testing (~> 1.0) @@ -268,56 +266,59 @@ GEM rspec-rails (~> 6.0) rspec-retry (~> 0.6.2) rspec_junit_formatter (~> 0.6.0) - rubocop (~> 1.50.0) + rubocop (~> 1.65.0) + rubocop-capybara (~> 2.21) + rubocop-factory_bot (~> 2.26) rubocop-faker (~> 1.1) - rubocop-rails (~> 2.19) - rubocop-rspec (~> 2.20) + rubocop-performance (~> 1.21) + rubocop-rails (~> 2.25) + rubocop-rspec (~> 3.0) + rubocop-rspec_rails (~> 2.30) + rubocop-rubycw (~> 0.1) selenium-webdriver (~> 4.9) simplecov (~> 0.22.0) simplecov-cobertura (~> 2.1.0) + spring (~> 4.0) + spring-watcher-listen (~> 2.0) w3c_rspec_validators (~> 0.3.0) webmock (~> 3.18) wisper-rspec (~> 1.0) - decidim-forms (0.28.1) - decidim-core (= 0.28.1) + decidim-forms (0.29.2) + decidim-core (= 0.29.2) wicked_pdf (~> 2.1) - wkhtmltopdf-binary (~> 0.12) - decidim-generators (0.28.1) - decidim-core (= 0.28.1) - decidim-meetings (0.28.1) - decidim-core (= 0.28.1) - decidim-forms (= 0.28.1) + decidim-generators (0.29.2) + decidim-core (= 0.29.2) + decidim-meetings (0.29.2) + decidim-core (= 0.29.2) + decidim-forms (= 0.29.2) icalendar (~> 2.5) - decidim-pages (0.28.1) - decidim-core (= 0.28.1) - decidim-participatory_processes (0.28.1) - decidim-core (= 0.28.1) - decidim-proposals (0.28.1) - decidim-comments (= 0.28.1) - decidim-core (= 0.28.1) - doc2text (~> 0.4.6) + decidim-pages (0.29.2) + decidim-core (= 0.29.2) + decidim-participatory_processes (0.29.2) + decidim-core (= 0.29.2) + decidim-proposals (0.29.2) + decidim-comments (= 0.29.2) + decidim-core (= 0.29.2) + doc2text (~> 0.4.7) redcarpet (~> 3.5, >= 3.5.1) - decidim-sortitions (0.28.1) - decidim-admin (= 0.28.1) - decidim-comments (= 0.28.1) - decidim-core (= 0.28.1) - decidim-proposals (= 0.28.1) - decidim-surveys (0.28.1) - decidim-core (= 0.28.1) - decidim-forms (= 0.28.1) - decidim-system (0.28.1) + decidim-sortitions (0.29.2) + decidim-admin (= 0.29.2) + decidim-comments (= 0.29.2) + decidim-core (= 0.29.2) + decidim-proposals (= 0.29.2) + decidim-surveys (0.29.2) + decidim-core (= 0.29.2) + decidim-forms (= 0.29.2) + decidim-system (0.29.2) active_link_to (~> 1.0) - decidim-core (= 0.28.1) + decidim-core (= 0.29.2) devise (~> 4.7) devise-i18n (~> 1.2) devise_invitable (~> 2.0, >= 2.0.9) - decidim-templates (0.28.1) - decidim-core (= 0.28.1) - decidim-forms (= 0.28.1) - decidim-verifications (0.28.1) - decidim-core (= 0.28.1) - declarative-builder (0.1.0) - declarative-option (< 0.2.0) + decidim-verifications (0.29.2) + decidim-core (= 0.29.2) + declarative-builder (0.2.0) + trailblazer-option (~> 0.1.0) declarative-option (0.1.0) deface (1.9.0) actionview (>= 5.2) @@ -333,16 +334,16 @@ GEM warden (~> 1.2.3) devise-i18n (1.11.0) devise (>= 4.9.0) - devise_invitable (2.0.9) + devise_invitable (2.0.10) actionmailer (>= 5.0) devise (>= 4.6) diff-lcs (1.5.1) - diffy (3.4.2) - doc2text (0.4.7) - nokogiri (>= 1.13.2, < 1.17.0) + diffy (3.4.3) + doc2text (0.4.8) + nokogiri (>= 1.18.2) rubyzip (~> 2.3.0) docile (1.4.0) - doorkeeper (5.7.1) + doorkeeper (5.8.1) railties (>= 5) doorkeeper-i18n (4.0.1) erb_lint (0.4.0) @@ -354,9 +355,10 @@ GEM smart_properties erbse (0.1.4) temple - erubi (1.13.0) - escape_utils (1.2.2) - excon (0.111.0) + erubi (1.13.1) + escape_utils (1.3.0) + excon (1.2.5) + logger extended-markdown-filter (0.7.0) html-pipeline (~> 2.9) factory_bot (6.4.6) @@ -366,21 +368,22 @@ GEM railties (>= 5.0.0) faker (3.3.1) i18n (>= 1.8.11, < 2) - faraday (2.10.0) - faraday-net_http (>= 2.0, < 3.2) + faraday (2.12.2) + faraday-net_http (>= 2.0, < 3.5) + json logger - faraday-net_http (3.1.0) - net-http - ffi (1.17.0) + faraday-net_http (3.4.0) + net-http (>= 0.5.0) + ffi (1.17.1) file_validators (3.0.0) activemodel (>= 3.2) mime-types (>= 1.0) - fog-core (2.4.0) + fog-core (2.6.0) builder - excon (~> 0.71) + excon (~> 1.0) formatador (>= 0.2, < 2.0) mime-types - fog-local (0.8.0) + fog-local (0.9.0) fog-core (>= 1.27, < 3.0) formatador (1.1.0) foundation_rails_helper (4.0.1) @@ -389,29 +392,29 @@ GEM activesupport (>= 4.1, < 7.1) railties (>= 4.1, < 7.1) gemoji (3.0.1) - geocoder (1.8.3) + geocoder (1.8.5) base64 (>= 0.1.0) csv (>= 3.0.0) globalid (1.2.1) activesupport (>= 6.1) - graphql (2.0.31) + graphql (2.2.17) base64 - graphql-docs (3.0.1) - commonmarker (~> 0.16) - escape_utils (~> 1.2.2) + graphql-docs (4.0.0) + commonmarker (~> 0.23, >= 0.23.6) + dartsass (~> 1.49) + escape_utils (~> 1.2) extended-markdown-filter (~> 0.4) gemoji (~> 3.0) graphql (~> 2.0) - html-pipeline (~> 2.9) - sass (~> 3.4) - hashdiff (1.1.0) + html-pipeline (~> 2.14, >= 2.14.3) + hashdiff (1.1.2) hashie (5.0.0) highline (3.0.1) html-pipeline (2.14.3) activesupport (>= 2) nokogiri (>= 1.4) htmlentities (4.3.4) - i18n (1.14.5) + i18n (1.14.7) concurrent-ruby (~> 1.0) i18n-tasks (1.0.14) activesupport (>= 4.0.2) @@ -424,16 +427,17 @@ GEM rainbow (>= 2.2.2, < 4.0) terminal-table (>= 1.5.1) i18n_data (0.11.0) - icalendar (2.10.1) + icalendar (2.10.3) ice_cube (~> 0.16) - ice_cube (0.16.4) - image_processing (1.12.2) - mini_magick (>= 4.9.5, < 5) + ostruct + ice_cube (0.17.0) + image_processing (1.14.0) + mini_magick (>= 4.9.5, < 6) ruby-vips (>= 2.0.17, < 3) invisible_captcha (0.13.0) rails (>= 3.2.0) - json (2.7.2) - jwt (2.8.2) + json (2.10.2) + jwt (2.10.1) base64 kaminari (1.2.2) activesupport (>= 4.1.0) @@ -447,6 +451,7 @@ GEM activerecord kaminari-core (= 1.2.2) kaminari-core (1.2.2) + language_server-protocol (3.17.0.4) launchy (3.1.0) addressable (~> 2.8) childprocess (~> 5.0) @@ -461,8 +466,8 @@ GEM listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - logger (1.6.0) - loofah (2.22.0) + logger (1.7.0) + loofah (2.24.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) mail (2.8.1) @@ -473,17 +478,20 @@ GEM marcel (1.0.4) matrix (0.4.2) method_source (1.1.0) - mime-types (3.5.2) + mime-types (3.6.2) + logger mime-types-data (~> 3.2015) - mime-types-data (3.2024.0702) + mime-types-data (3.2025.0325) mini_magick (4.13.2) mini_mime (1.1.5) - minitest (5.24.1) + mini_portile2 (2.8.8) + minitest (5.25.5) msgpack (1.7.2) - multi_xml (0.6.0) - net-http (0.4.1) + multi_xml (0.7.1) + bigdecimal (~> 3.1) + net-http (0.6.0) uri - net-imap (0.4.14) + net-imap (0.5.6) date net-protocol net-pop (0.1.2) @@ -492,10 +500,9 @@ GEM timeout net-smtp (0.3.4) net-protocol - nio4r (2.7.3) - nokogiri (1.16.6-x86_64-darwin) - racc (~> 1.4) - nokogiri (1.16.6-x86_64-linux) + nio4r (2.7.4) + nokogiri (1.18.7) + mini_portile2 (~> 2.8.2) racc (~> 1.4) oauth (1.1.0) oauth-tty (~> 1.0, >= 1.0.1) @@ -510,20 +517,21 @@ GEM rack (>= 1.2, < 4) snaky_hash (~> 2.0) version_gem (~> 1.1) - omniauth (2.1.2) + omniauth (2.1.3) hashie (>= 3.4.6) rack (>= 2.2.3) rack-protection omniauth-facebook (5.0.0) omniauth-oauth2 (~> 1.2) - omniauth-google-oauth2 (1.1.2) - jwt (>= 2.0) + omniauth-google-oauth2 (1.2.1) + jwt (>= 2.9.2) oauth2 (~> 2.0) omniauth (~> 2.0) omniauth-oauth2 (~> 1.8) - omniauth-oauth (1.2.0) + omniauth-oauth (1.2.1) oauth omniauth (>= 1.0, < 3) + rack (>= 1.6.2, < 4) omniauth-oauth2 (1.8.0) oauth2 (>= 1.4, < 3) omniauth (~> 2.0) @@ -533,8 +541,9 @@ GEM omniauth-twitter (1.4.0) omniauth-oauth (~> 1.1) rack - openssl (3.2.0) + openssl (3.3.0) orm_adapter (0.5.0) + ostruct (0.6.1) paper_trail (12.3.0) activerecord (>= 5.2) request_store (~> 1.1) @@ -545,13 +554,13 @@ GEM ast (~> 2.4.1) racc pg (1.4.6) - pg_search (2.3.6) - activerecord (>= 5.2) - activesupport (>= 5.2) + pg_search (2.3.7) + activerecord (>= 6.1) + activesupport (>= 6.1) polyglot (0.3.5) - premailer (1.23.0) + premailer (1.27.0) addressable - css_parser (>= 1.12.0) + css_parser (>= 1.19.0) htmlentities (>= 4.0.0) premailer-rails (1.12.0) actionmailer (>= 3) @@ -559,11 +568,11 @@ GEM premailer (~> 1.7, >= 1.7.9) psych (4.0.6) stringio - public_suffix (6.0.0) + public_suffix (6.0.1) puma (6.4.2) nio4r (~> 2.0) - racc (1.8.0) - rack (2.2.9) + racc (1.8.1) + rack (2.2.13) rack-attack (6.7.0) rack (>= 1.0, < 4) rack-cors (1.1.1) @@ -573,23 +582,22 @@ GEM rack (~> 2.2, >= 2.2.4) rack-proxy (0.7.7) rack - rack-test (2.1.0) + rack-test (2.2.0) rack (>= 1.3) - rails (6.1.7.8) - actioncable (= 6.1.7.8) - actionmailbox (= 6.1.7.8) - actionmailer (= 6.1.7.8) - actionpack (= 6.1.7.8) - actiontext (= 6.1.7.8) - actionview (= 6.1.7.8) - activejob (= 6.1.7.8) - activemodel (= 6.1.7.8) - activerecord (= 6.1.7.8) - activestorage (= 6.1.7.8) - activesupport (= 6.1.7.8) + rails (7.0.8.7) + actioncable (= 7.0.8.7) + actionmailbox (= 7.0.8.7) + actionmailer (= 7.0.8.7) + actionpack (= 7.0.8.7) + actiontext (= 7.0.8.7) + actionview (= 7.0.8.7) + activejob (= 7.0.8.7) + activemodel (= 7.0.8.7) + activerecord (= 7.0.8.7) + activestorage (= 7.0.8.7) + activesupport (= 7.0.8.7) bundler (>= 1.15.0) - railties (= 6.1.7.8) - sprockets-rails (>= 2.0.0) + railties (= 7.0.8.7) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -598,18 +606,19 @@ GEM activesupport (>= 5.0.0) minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.6.0) + rails-html-sanitizer (1.6.2) loofah (~> 2.21) - nokogiri (~> 1.14) - rails-i18n (6.0.0) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + rails-i18n (7.0.10) i18n (>= 0.7, < 2) - railties (>= 6.0.0, < 7) - railties (6.1.7.8) - actionpack (= 6.1.7.8) - activesupport (= 6.1.7.8) + railties (>= 6.0.0, < 8) + railties (7.0.8.7) + actionpack (= 7.0.8.7) + activesupport (= 7.0.8.7) method_source rake (>= 12.2) thor (~> 1.0) + zeitwerk (~> 2.5) rainbow (3.1.1) rake (13.2.1) ransack (3.2.1) @@ -619,7 +628,7 @@ GEM rb-fsevent (0.11.2) rb-inotify (0.11.1) ffi (~> 1.0) - redcarpet (3.6.0) + redcarpet (3.6.1) redis (4.8.1) regexp_parser (2.9.2) request_store (1.5.1) @@ -660,57 +669,56 @@ GEM rspec-support (3.13.1) rspec_junit_formatter (0.6.0) rspec-core (>= 2, < 4, != 2.12.0) - rubocop (1.50.2) + rubocop (1.65.1) json (~> 2.3) + language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.2.0.0) + parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) + regexp_parser (>= 2.4, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.28.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) rubocop-ast (1.31.3) parser (>= 3.3.1.0) rubocop-capybara (2.21.0) rubocop (~> 1.41) - rubocop-factory_bot (2.25.1) - rubocop (~> 1.41) + rubocop-factory_bot (2.26.1) + rubocop (~> 1.61) rubocop-faker (1.1.0) faker (>= 2.12.0) rubocop (>= 0.82.0) + rubocop-performance (1.23.1) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) rubocop-rails (2.25.1) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) - rubocop-rspec (2.31.0) - rubocop (~> 1.40) - rubocop-capybara (~> 2.17) - rubocop-factory_bot (~> 2.22) - rubocop-rspec_rails (~> 2.28) - rubocop-rspec_rails (2.28.3) - rubocop (~> 1.40) + rubocop-rspec (3.4.0) + rubocop (~> 1.61) + rubocop-rspec_rails (2.30.0) + rubocop (~> 1.61) + rubocop-rspec (~> 3, >= 3.0.1) + rubocop-rubycw (0.1.6) + rubocop (~> 1.0) ruby-progressbar (1.13.0) - ruby-vips (2.2.1) + ruby-vips (2.2.3) ffi (~> 1.12) - rubyXL (3.4.27) + logger + rubyXL (3.4.33) 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) selenium-webdriver (4.22.0) base64 (~> 0.2) logger (~> 1.4) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) - semantic_range (3.0.0) - seven_zip_ruby (1.3.0) + semantic_range (3.1.0) shakapacker (7.1.0) activesupport (>= 5.2) rack-proxy (>= 0.6.1) @@ -732,37 +740,30 @@ GEM version_gem (~> 1.1, >= 1.1.1) sort_alphabetical (1.1.0) unicode_utils (>= 1.2.2) - spring (2.1.1) - spring-watcher-listen (2.0.1) + spring (4.3.0) + spring-watcher-listen (2.1.0) listen (>= 2.7, < 4.0) - spring (>= 1.2, < 3.0) - sprockets (4.2.1) - concurrent-ruby (~> 1.0) - rack (>= 2.2.4, < 4) - sprockets-rails (3.5.1) - actionpack (>= 6.1) - activesupport (>= 6.1) - sprockets (>= 3.0.0) - ssrf_filter (1.1.2) - stringio (3.1.1) + spring (>= 4) + stringio (3.1.6) strscan (3.1.0) temple (0.10.3) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) - thor (1.3.1) - tilt (2.4.0) - timeout (0.4.1) + thor (1.3.2) + tilt (2.6.0) + timeout (0.4.3) + trailblazer-option (0.1.2) tzinfo (2.0.6) concurrent-ruby (~> 1.0) uber (0.1.0) unicode-display_width (2.5.0) unicode_utils (1.4.0) uniform_notifier (1.16.0) - uri (0.13.0) + uri (1.0.3) valid_email2 (4.0.6) activemodel (>= 3.2) mail (~> 2.5) - version_gem (1.1.4) + version_gem (1.1.6) w3c_rspec_validators (0.3.0) rails rspec @@ -786,42 +787,37 @@ GEM crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) websocket (1.2.10) - websocket-driver (0.7.6) + websocket-driver (0.7.7) + base64 websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - wicked_pdf (2.8.0) + wicked_pdf (2.8.2) activesupport + ostruct wisper (2.0.1) wisper-rspec (1.1.0) - wkhtmltopdf-binary (0.12.6.7) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.16) + zeitwerk (2.7.2) PLATFORMS - x86_64-darwin-24 - x86_64-linux + ruby DEPENDENCIES - bootsnap (~> 1.3) + bootsnap (~> 1.7) byebug (~> 11.0) - country_select (~> 4.0) - decidim (~> 0.28) - decidim-dev (~> 0.28) + decidim (~> 0.29.2) + decidim-dev (~> 0.29.2) decidim-extra_user_fields! faker (~> 3.3.1) letter_opener_web (~> 2.0) listen (~> 3.1) - puma (>= 4.3) - rubocop-factory_bot (!= 2.26.0) + puma (>= 6.3.1) rubocop-faker - rubocop-rspec_rails (!= 2.29.0) - spring (~> 2.0) - spring-watcher-listen (~> 2.0) web-console (~> 4.2) RUBY VERSION - ruby 3.1.1p18 + ruby 3.2.6p234 BUNDLED WITH - 2.4.10 + 2.6.5 diff --git a/README.md b/README.md index 9eb281f..8823339 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,12 @@ This module also enables an Export action in the participants admin panel, which Pick the version of the gem that matches your Decidim version. +For Decidim 0.28: + +```ruby +gem "decidim-extra_user_fields", git: "https://github.com/PopulateTools/decidim-module-extra_user_fields.git", branch: "release/0.28-stable" +``` + For Decidim 0.27: ```ruby diff --git a/app/commands/concerns/decidim/extra_user_fields/update_account_commands_overrides.rb b/app/commands/concerns/decidim/extra_user_fields/update_account_commands_overrides.rb index 2907c1e..41989f6 100644 --- a/app/commands/concerns/decidim/extra_user_fields/update_account_commands_overrides.rb +++ b/app/commands/concerns/decidim/extra_user_fields/update_account_commands_overrides.rb @@ -11,17 +11,17 @@ module UpdateAccountCommandsOverrides private def update_personal_data - @user.locale = @form.locale - @user.name = @form.name - @user.nickname = @form.nickname - @user.email = @form.email - @user.personal_url = @form.personal_url - @user.about = @form.about - @user.extended_data = extended_data + current_user.locale = @form.locale + current_user.name = @form.name + current_user.nickname = @form.nickname + current_user.email = @form.email + current_user.personal_url = @form.personal_url + current_user.about = @form.about + current_user.extended_data = extended_data end def extended_data - @extended_data ||= (@user&.extended_data || {}).merge( + @extended_data ||= (current_user&.extended_data || {}).merge( country: @form.country, postal_code: @form.postal_code, date_of_birth: @form.date_of_birth, diff --git a/app/forms/concerns/decidim/extra_user_fields/forms_definitions.rb b/app/forms/concerns/decidim/extra_user_fields/forms_definitions.rb index 982d7ac..d35b8bb 100644 --- a/app/forms/concerns/decidim/extra_user_fields/forms_definitions.rb +++ b/app/forms/concerns/decidim/extra_user_fields/forms_definitions.rb @@ -89,7 +89,7 @@ def phone_number? end def phone_number_format? - return unless phone_number? + return false unless phone_number? current_organization.extra_user_field_configuration(:phone_number)["pattern"].present? end diff --git a/app/overrides/decidim/account/show/extra_user_fields.html.erb.deface b/app/overrides/decidim/account/show/extra_user_fields.html.erb.deface index 87a24c9..5cbbd42 100644 --- a/app/overrides/decidim/account/show/extra_user_fields.html.erb.deface +++ b/app/overrides/decidim/account/show/extra_user_fields.html.erb.deface @@ -1,3 +1,3 @@ - + <%= render partial: "/decidim/extra_user_fields/profile_form", locals: { f: f } %> diff --git a/app/views/decidim/extra_user_fields/_profile_form.html.erb b/app/views/decidim/extra_user_fields/_profile_form.html.erb index 46473e0..e9d6218 100644 --- a/app/views/decidim/extra_user_fields/_profile_form.html.erb +++ b/app/views/decidim/extra_user_fields/_profile_form.html.erb @@ -1,6 +1,6 @@ <% if current_organization.extra_user_fields_enabled? %> <% if current_organization.activated_extra_field?(:date_of_birth) %> - <%= f.date_field :date_of_birth %> +
<%= f.date_field :date_of_birth %>
<% end %> <% if current_organization.activated_extra_field?(:gender) %> diff --git a/app/views/decidim/extra_user_fields/_registration_form.html.erb b/app/views/decidim/extra_user_fields/_registration_form.html.erb index 1445088..c03d28c 100644 --- a/app/views/decidim/extra_user_fields/_registration_form.html.erb +++ b/app/views/decidim/extra_user_fields/_registration_form.html.erb @@ -3,7 +3,7 @@

<%= t(".signup.legend") %>

<% if current_organization.activated_extra_field?(:date_of_birth) %> - <%= f.date_field :date_of_birth, id: "user_date_of_birth" %> +
<%= f.date_field :date_of_birth, id: "user_date_of_birth" %>
<% end %> <% if current_organization.activated_extra_field?(:gender) %> diff --git a/bin/dev b/bin/dev new file mode 100755 index 0000000..e009f8d --- /dev/null +++ b/bin/dev @@ -0,0 +1,5 @@ +#!/usr/bin/env sh + +cd development_app + +./bin/dev diff --git a/decidim-extra_user_fields.gemspec b/decidim-extra_user_fields.gemspec index 50077d9..a5935e2 100644 --- a/decidim-extra_user_fields.gemspec +++ b/decidim-extra_user_fields.gemspec @@ -10,7 +10,7 @@ Gem::Specification.new do |s| s.email = ["fernando@populate.tools"] s.license = "AGPL-3.0" s.homepage = "https://github.com/PopulateTools/decidim-module-extra_user_fields" - s.required_ruby_version = ">= 3.0.2" + s.required_ruby_version = ">= 3.2.0" s.name = "decidim-extra_user_fields" s.summary = "Decidim module to add extra fields to users." diff --git a/lib/decidim/extra_user_fields/admin_engine.rb b/lib/decidim/extra_user_fields/admin_engine.rb index 0c058a3..e398626 100644 --- a/lib/decidim/extra_user_fields/admin_engine.rb +++ b/lib/decidim/extra_user_fields/admin_engine.rb @@ -17,7 +17,7 @@ class AdminEngine < ::Rails::Engine end resources :extra_user_fields, only: [:index] - match "/extra_user_fields" => "extra_user_fields#update", :via => :patch, as: "update" + match "/extra_user_fields" => "extra_user_fields#update", :via => :patch, :as => "update" root to: "extra_user_fields#index" end diff --git a/lib/decidim/extra_user_fields/form_builder_methods.rb b/lib/decidim/extra_user_fields/form_builder_methods.rb index a1345a3..378d34a 100644 --- a/lib/decidim/extra_user_fields/form_builder_methods.rb +++ b/lib/decidim/extra_user_fields/form_builder_methods.rb @@ -5,13 +5,18 @@ module ExtraUserFields # This module adds the FormBuilder methods for extra user fields module FormBuilderMethods def custom_country_select(name, options = {}) - label_text = options[:label].to_s - label_text = label_for(name) if label_text.blank? + label_text = options[:label].presence || label_for(name) + html = +"" + html << (label_text + required_for_attribute(name)) if options.fetch(:label, true) + html << sanitize_country_select(country_select(name)) + html.html_safe + end + + private - template = "" - template += (label_text + required_for_attribute(name)) if options.fetch(:label, true) - template += country_select(name) - template.html_safe + # Remove non-standard attrs added by country_select that fail HTML/accessibility validation + def sanitize_country_select(html) + html.gsub(/\s(skip_default_ids|allow_method_names_outside_object)="[^"]*"/, "") end end end diff --git a/lib/decidim/extra_user_fields/version.rb b/lib/decidim/extra_user_fields/version.rb index f28f7fe..5349aae 100644 --- a/lib/decidim/extra_user_fields/version.rb +++ b/lib/decidim/extra_user_fields/version.rb @@ -4,11 +4,11 @@ module Decidim # This holds the decidim-extra_user_fields version. module ExtraUserFields def self.version - "0.28.0" + "0.29.0" end def self.decidim_version - [">= 0.28"].freeze + [">= 0.29"].freeze end end end diff --git a/spec/factories.rb b/spec/factories.rb index 3fda653..b362b31 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -9,7 +9,10 @@ create_static_pages { true } end - name { Faker::Company.unique.name } + name do + Decidim.available_locales.index_with { |_locale| Faker::Company.unique.name } + end + reference_prefix { Faker::Name.suffix } time_zone { "UTC" } twitter_handler { Faker::Hipster.word } @@ -34,7 +37,7 @@ admin_terms_of_service_body { Decidim::Faker::Localized.wrapped("

", "

") { generate_localized_title } } force_users_to_authenticate_before_access_organization { false } machine_translation_display_priority { "original" } - external_domain_whitelist { ["example.org", "twitter.com", "facebook.com", "youtube.com", "github.com", "mytesturl.me"] } + external_domain_allowlist { ["example.org", "twitter.com", "facebook.com", "youtube.com", "github.com", "mytesturl.me"] } smtp_settings do { "from" => "test@example.org", diff --git a/spec/forms/decidim/registration_form_spec.rb b/spec/forms/decidim/registration_form_spec.rb index 7d46383..b04f8f3 100644 --- a/spec/forms/decidim/registration_form_spec.rb +++ b/spec/forms/decidim/registration_form_spec.rb @@ -154,7 +154,7 @@ module Decidim context "when the nickname already exists" do context "and a user has the nickname" do - let!(:another_user) { create(:user, organization:, nickname: name.upcase) } + let!(:another_user) { create(:user, organization:, nickname: name) } it { is_expected.to be_valid } diff --git a/spec/lib/overrides_spec.rb b/spec/lib/overrides_spec.rb new file mode 100644 index 0000000..1f5cbe4 --- /dev/null +++ b/spec/lib/overrides_spec.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +require "spec_helper" + +# We make sure that the checksum of the file overriden is the same +# as the expected. If this test fails, it means that the overriden +# file should be updated to match any change/bug fix introduced in the core +checksums = [ + { + package: "decidim-core", + files: { + "/app/commands/decidim/create_registration.rb" => "c2fafd313dbe16624e3ef07584e946cd", + "/app/commands/decidim/create_omniauth_registration.rb" => "5bca48c990c3b82d47119902c0a56ca1", + "/app/commands/decidim/update_account.rb" => "d24090fdd9358c38e6e15c4607a78e18", + "/app/models/decidim/organization.rb" => "a72b9d9ef10aa06dbe5aef27c68d5c7a", + "/app/views/decidim/account/show.html.erb" => "f13218e2358a2d611996c2a197c0de25", + "/app/views/decidim/devise/registrations/new.html.erb" => "b30423406afd43bb9af2c98d59d43632", + "/app/views/decidim/devise/omniauth_registrations/new.html.erb" => "49f44efcd7ae6f87c04b309733ff28f6" + } + }, + { + package: "decidim-admin", + files: { + "/app/views/decidim/admin/officializations/index.html.erb" => "e849c5dbaf04379bf233c15e860e1a18" + } + } +] + +describe "Overriden files", type: :view do + checksums.each do |item| + spec = Gem::Specification.find_by_name(item[:package]) + item[:files].each do |file, signature| + it "#{spec.gem_dir}#{file} matches checksum" do + expect(md5("#{spec.gem_dir}#{file}")).to eq(signature) + end + end + end + + private + + def md5(file) + Digest::MD5.hexdigest(File.read(file)) + end +end diff --git a/spec/models/decidim/organization_spec.rb b/spec/models/decidim/organization_spec.rb index 4760cfc..57ff74a 100644 --- a/spec/models/decidim/organization_spec.rb +++ b/spec/models/decidim/organization_spec.rb @@ -32,6 +32,10 @@ module Decidim enabled: true, client_id: nil, client_secret: nil + }, + test: { + enabled: true, + icon: "tools-line" } } end diff --git a/spec/system/account_spec.rb b/spec/system/account_spec.rb index 5c66f68..94f4e08 100644 --- a/spec/system/account_spec.rb +++ b/spec/system/account_spec.rb @@ -80,7 +80,17 @@ visit decidim.account_path end - it_behaves_like "accessible page" + context "when all extra fields are accessible-compatible" do + let(:date_of_birth) { { "enabled" => false } } + + # NOTE: We skip running the accessibility test when `date_of_birth` is enabled + # because the custom Decidim datepicker JavaScript removes accessibility attributes + # like `title`, `aria-label`, and causes Axe validation errors. + # + # This test runs only when `date_of_birth` is disabled to avoid false negatives. + + it_behaves_like "accessible page" + end describe "updating personal data" do let!(:encrypted_password) { user.encrypted_password } @@ -92,7 +102,7 @@ fill_in :user_personal_url, with: "https://example.org" fill_in :user_about, with: "A Serbian-American inventor, electrical engineer, mechanical engineer, physicist, and futurist." - fill_in :user_date_of_birth, with: "01/01/2000" + fill_in :user_date_of_birth_date, with: "01/01/2000" select "Other", from: :user_gender select "Argentina", from: :user_country fill_in :user_postal_code, with: "00000" @@ -132,7 +142,7 @@ end it "shows error when image is too big" do - find("#user_avatar_button").click + find_by_id("user_avatar_button").click within ".upload-modal" do click_on "Remove" @@ -222,7 +232,7 @@ fill_in :user_personal_url, with: "https://example.org" fill_in :user_about, with: "A Serbian-American inventor, electrical engineer, mechanical engineer, physicist, and futurist." - fill_in :user_date_of_birth, with: "01/01/2000" + fill_in :user_date_of_birth_date, with: "01/01/2000" select "Other", from: :user_gender select "Argentina", from: :user_country fill_in :user_postal_code, with: "00000" @@ -282,7 +292,7 @@ fill_in :user_personal_url, with: "https://example.org" fill_in :user_about, with: "A Serbian-American inventor, electrical engineer, mechanical engineer, physicist, and futurist." - fill_in :user_date_of_birth, with: "01/01/2000" + fill_in :user_date_of_birth_date, with: "01/01/2000" select "Other", from: :user_gender select "Argentina", from: :user_country fill_in :user_postal_code, with: "00000" @@ -302,7 +312,7 @@ it "toggles the current password" do expect(page).to have_content("In order to confirm the changes to your account, please provide your current password.") - expect(find("#user_old_password")).to be_visible + expect(find_by_id("user_old_password")).to be_visible expect(page).to have_content "Current password" expect(page).to have_no_content "Password" end @@ -536,7 +546,7 @@ expect(page).to have_content("successfully") end - find(:css, "#allow_push_notifications", visible: false).execute_script("this.checked = true") + find_by_id("allow_push_notifications", visible: false).execute_script("this.checked = true") end end end diff --git a/spec/system/admin_manages_officializations_spec.rb b/spec/system/admin_manages_officializations_spec.rb index 93a1b69..815ef71 100644 --- a/spec/system/admin_manages_officializations_spec.rb +++ b/spec/system/admin_manages_officializations_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe "Admin manages officializations" do +describe "Admin manages officializations" do # rubocop:disable RSpec/DescribeClass include_context "with filterable context" let(:model_name) { Decidim::User.model_name } diff --git a/spec/system/admin_manages_organization_extra_user_fields_spec.rb b/spec/system/admin_manages_organization_extra_user_fields_spec.rb index 1c46fec..2cfcd72 100644 --- a/spec/system/admin_manages_organization_extra_user_fields_spec.rb +++ b/spec/system/admin_manages_organization_extra_user_fields_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe "Admin manages organization extra user fields" do +describe "Admin manages organization extra user fields" do # rubocop:disable RSpec/DescribeClass let(:organization) { create(:organization) } let(:user) { create(:user, :admin, :confirmed, organization:) } diff --git a/spec/system/registration_spec.rb b/spec/system/registration_spec.rb index 9250b93..317aab3 100644 --- a/spec/system/registration_spec.rb +++ b/spec/system/registration_spec.rb @@ -11,7 +11,7 @@ def fill_registration_form end def fill_extra_user_fields - fill_in :registration_user_date_of_birth, with: "01/01/2000" + fill_in :registration_user_date_of_birth_date, with: "01/01/2000" select "Other", from: :registration_user_gender select "Argentina", from: :registration_user_country fill_in :registration_user_postal_code, with: "00000" @@ -22,7 +22,7 @@ def fill_extra_user_fields # EndBlock end -describe "Extra user fields" do +describe "Extra user fields" do # rubocop:disable RSpec/DescribeClass shared_examples_for "mandatory extra user fields" do |field| it "displays #{field} as mandatory" do within "label[for='registration_user_#{field}']" do