decidim-dev 0.21.0 → 0.23.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/decidim/dummy.svg +1 -4
  3. data/app/assets/images/decidim/gamification/badges/test.svg +1 -145
  4. data/app/commands/decidim/dummy_resources/create_dummy_resource.rb +48 -0
  5. data/app/controllers/decidim/dummy_resources/dummy_resources_controller.rb +1 -0
  6. data/app/forms/decidim/dummy_resources/dummy_resource_form.rb +3 -0
  7. data/app/mailers/decidim/dummy_resources/dummy_resource_mailer.rb +17 -0
  8. data/app/views/decidim/dummy_resources/dummy_resources/show.html.erb +4 -0
  9. data/config/locales/am-ET.yml +1 -0
  10. data/config/locales/bg-BG.yml +56 -0
  11. data/config/locales/bg.yml +56 -0
  12. data/config/locales/ca.yml +15 -0
  13. data/config/locales/cs.yml +16 -1
  14. data/config/locales/da-DK.yml +1 -0
  15. data/config/locales/da.yml +1 -0
  16. data/config/locales/de.yml +17 -1
  17. data/config/locales/el.yml +55 -0
  18. data/config/locales/en.yml +15 -0
  19. data/config/locales/eo.yml +1 -0
  20. data/config/locales/es-MX.yml +15 -0
  21. data/config/locales/es-PY.yml +15 -0
  22. data/config/locales/es.yml +15 -0
  23. data/config/locales/et-EE.yml +1 -0
  24. data/config/locales/et.yml +1 -0
  25. data/config/locales/fi-plain.yml +15 -0
  26. data/config/locales/fi.yml +15 -0
  27. data/config/locales/fr-CA.yml +56 -0
  28. data/config/locales/fr.yml +15 -0
  29. data/config/locales/ga-IE.yml +1 -0
  30. data/config/locales/hr-HR.yml +1 -0
  31. data/config/locales/hr.yml +1 -0
  32. data/config/locales/hu.yml +9 -0
  33. data/config/locales/is.yml +21 -0
  34. data/config/locales/it.yml +17 -2
  35. data/config/locales/ja-JP.yml +56 -0
  36. data/config/locales/ja.yml +56 -0
  37. data/config/locales/ko-KR.yml +1 -0
  38. data/config/locales/ko.yml +1 -0
  39. data/config/locales/lt-LT.yml +1 -0
  40. data/config/locales/lt.yml +1 -0
  41. data/config/locales/lv.yml +54 -0
  42. data/config/locales/mt-MT.yml +1 -0
  43. data/config/locales/mt.yml +1 -0
  44. data/config/locales/nl.yml +15 -0
  45. data/config/locales/om-ET.yml +1 -0
  46. data/config/locales/pl.yml +26 -10
  47. data/config/locales/pt-BR.yml +1 -1
  48. data/config/locales/pt.yml +26 -10
  49. data/config/locales/ro-RO.yml +56 -0
  50. data/config/locales/si-LK.yml +1 -0
  51. data/config/locales/sk-SK.yml +47 -0
  52. data/config/locales/sk.yml +47 -0
  53. data/config/locales/sl.yml +5 -0
  54. data/config/locales/so-SO.yml +1 -0
  55. data/config/locales/sr-CS.yml +8 -0
  56. data/config/locales/sv.yml +15 -0
  57. data/config/locales/sw-KE.yml +1 -0
  58. data/config/locales/ti-ER.yml +1 -0
  59. data/config/locales/tr-TR.yml +25 -9
  60. data/config/locales/vi-VN.yml +1 -0
  61. data/config/locales/vi.yml +1 -0
  62. data/config/locales/zh-CN.yml +56 -0
  63. data/config/locales/zh-TW.yml +1 -0
  64. data/lib/decidim/dev.rb +2 -0
  65. data/lib/decidim/dev/assets/5000x5000.png +0 -0
  66. data/lib/decidim/dev/assets/assemblies.json +816 -0
  67. data/lib/decidim/dev/assets/assemblies_with_null.json +135 -0
  68. data/lib/decidim/dev/assets/city.jpeg +0 -0
  69. data/lib/decidim/dev/assets/city2.jpeg +0 -0
  70. data/lib/decidim/dev/assets/city3.jpeg +0 -0
  71. data/lib/decidim/dev/assets/geocoder_result_here.json +72 -0
  72. data/lib/decidim/dev/assets/geocoder_result_osm.json +150 -0
  73. data/lib/decidim/dev/assets/import_participatory_space_private_users_nok.csv +2 -0
  74. data/lib/decidim/dev/dummy_translator.rb +32 -0
  75. data/lib/decidim/dev/test/rspec_support/authorization.rb +3 -0
  76. data/lib/decidim/dev/test/rspec_support/capybara.rb +5 -1
  77. data/lib/decidim/dev/test/rspec_support/capybara_data_picker.rb +15 -5
  78. data/lib/decidim/dev/test/rspec_support/capybara_scopes_picker.rb +5 -5
  79. data/lib/decidim/dev/test/rspec_support/component.rb +111 -9
  80. data/lib/decidim/dev/test/rspec_support/component_context.rb +1 -2
  81. data/lib/decidim/dev/test/rspec_support/confirmation_helpers.rb +60 -0
  82. data/lib/decidim/dev/test/rspec_support/content_processing.rb +2 -2
  83. data/lib/decidim/dev/test/rspec_support/frontend.rb +20 -0
  84. data/lib/decidim/dev/test/rspec_support/geocoder.rb +150 -6
  85. data/lib/decidim/dev/test/rspec_support/helpers.rb +2 -2
  86. data/lib/decidim/dev/test/rspec_support/organization.rb +7 -0
  87. data/lib/decidim/dev/test/rspec_support/rake_tasks.rb +75 -0
  88. data/lib/decidim/dev/test/rspec_support/translation_helpers.rb +2 -0
  89. data/lib/decidim/dev/version.rb +1 -1
  90. data/lib/tasks/generators.rake +2 -1
  91. data/lib/tasks/locale_checker.rake +1 -1
  92. metadata +62 -14
  93. data/lib/decidim/dev/test/rspec_support/capybara_proposals_picker.rb +0 -51
@@ -10,14 +10,14 @@ module Decidim::ComponentTestHelpers
10
10
 
11
11
  def within_user_menu
12
12
  within ".topbar__user__logged" do
13
- find("a", text: user.name).hover
13
+ find("a", text: user.name).click
14
14
  yield
15
15
  end
16
16
  end
17
17
 
18
18
  def within_language_menu
19
19
  within ".topbar__dropmenu.language-choose" do
20
- find("ul.dropdown.menu").hover
20
+ find("ul.dropdown.menu").click
21
21
  yield
22
22
  end
23
23
  end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ RSpec.configure do |config|
4
+ config.after do
5
+ Decidim::OrganizationSettings.reset!
6
+ end
7
+ end
@@ -0,0 +1,75 @@
1
+ # frozen_string_literal: true
2
+
3
+ # File: spec/support/tasks.rb
4
+ require "rake"
5
+
6
+ # Task names should be used in the top-level describe, with an optional
7
+ # "rake "-prefix for better documentation. Both of these will work:
8
+ #
9
+ # 1) describe "foo:bar" do ... end
10
+ #
11
+ # 2) describe "rake foo:bar" do ... end
12
+ #
13
+ # Favor including "rake "-prefix as in the 2nd example above as it produces
14
+ # doc output that makes it clear a rake task is under test and how it is
15
+ # invoked.
16
+ module TaskExampleGroup
17
+ extend ActiveSupport::Concern
18
+
19
+ included do
20
+ # Make the Rake task available as `task` in your examples:
21
+ subject(:task) { tasks[task_name] }
22
+
23
+ let(:task_name) { self.class.top_level_description.sub(/\Arake /, "") }
24
+ let(:tasks) { Rake::Task }
25
+ end
26
+ end
27
+
28
+ # A collection of methods to help dealing with rake tasks output.
29
+ module RakeTaskOutputHelpers
30
+ extend ActiveSupport::Concern
31
+
32
+ included do
33
+ let!(:original_stdout) { $stdout }
34
+
35
+ # rubocop:disable RSpec/ExpectOutput
36
+ before do
37
+ $stdout = StringIO.new
38
+ end
39
+
40
+ after do
41
+ $stdout = original_stdout
42
+ end
43
+ # rubocop:enable RSpec/ExpectOutput
44
+ end
45
+
46
+ def check_no_errors_have_been_printed
47
+ expect($stdout.string).not_to include("ERROR:")
48
+ end
49
+
50
+ def check_some_errors_have_been_printed
51
+ expect($stdout.string).to include("ERROR:")
52
+ end
53
+
54
+ def check_error_printed(type)
55
+ expect($stdout.string).to include("ERROR: [#{type}]")
56
+ end
57
+
58
+ def check_message_printed(message)
59
+ expect($stdout.string).to include(message)
60
+ end
61
+ end
62
+
63
+ RSpec.configure do |config|
64
+ # Tag Rake specs with `:task` metadata or put them in the spec/tasks dir
65
+ config.define_derived_metadata(file_path: %r{/spec/tasks/}) do |metadata|
66
+ metadata[:type] = :task
67
+ end
68
+
69
+ config.include TaskExampleGroup, type: :task
70
+ config.include RakeTaskOutputHelpers, type: :task
71
+
72
+ config.before(:suite) do
73
+ Rails.application.load_tasks
74
+ end
75
+ end
@@ -13,6 +13,8 @@ module TranslationHelpers
13
13
  # It is intended to be used to avoid the implementation details, so that the
14
14
  # translated attributes implementation can change more easily.
15
15
  def translated(field, locale: I18n.locale)
16
+ return field if field.is_a?(String)
17
+
16
18
  field.try(:[], locale.to_s)
17
19
  end
18
20
 
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-dev version.
5
5
  module Dev
6
6
  def self.version
7
- "0.21.0"
7
+ "0.23.2"
8
8
  end
9
9
  end
10
10
  end
@@ -44,7 +44,8 @@ namespace :decidim do
44
44
  "..",
45
45
  "--recreate_db",
46
46
  "--seed_db",
47
- "--demo"
47
+ "--demo",
48
+ "--profiling"
48
49
  )
49
50
  end
50
51
  end
@@ -5,7 +5,7 @@ namespace :decidim do
5
5
  task check_locales: :environment do
6
6
  FileUtils.remove_dir("tmp/decidim_repo", true)
7
7
 
8
- branch = ENV["TARGET_BRANCH"] || "master"
8
+ branch = ENV["TARGET_BRANCH"] || "develop"
9
9
  status = system("git clone --depth=1 --single-branch --branch #{branch} https://github.com/decidim/decidim tmp/decidim_repo")
10
10
  return unless status
11
11
 
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-dev
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.0
4
+ version: 0.23.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josep Jaume Rey Peroy
8
8
  - Marc Riera Casals
9
9
  - Oriol Gual Oliva
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-04-08 00:00:00.000000000 Z
13
+ date: 2021-02-09 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: capybara
@@ -32,14 +32,14 @@ dependencies:
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 0.21.0
35
+ version: 0.23.2
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - '='
41
41
  - !ruby/object:Gem::Version
42
- version: 0.21.0
42
+ version: 0.23.2
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: factory_bot_rails
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -116,14 +116,14 @@ dependencies:
116
116
  requirements:
117
117
  - - "~>"
118
118
  - !ruby/object:Gem::Version
119
- version: 0.5.0
119
+ version: '0.5'
120
120
  type: :runtime
121
121
  prerelease: false
122
122
  version_requirements: !ruby/object:Gem::Requirement
123
123
  requirements:
124
124
  - - "~>"
125
125
  - !ruby/object:Gem::Version
126
- version: 0.5.0
126
+ version: '0.5'
127
127
  - !ruby/object:Gem::Dependency
128
128
  name: nokogiri
129
129
  requirement: !ruby/object:Gem::Requirement
@@ -298,14 +298,14 @@ dependencies:
298
298
  requirements:
299
299
  - - "~>"
300
300
  - !ruby/object:Gem::Version
301
- version: 0.18.5
301
+ version: 0.19.0
302
302
  type: :runtime
303
303
  prerelease: false
304
304
  version_requirements: !ruby/object:Gem::Requirement
305
305
  requirements:
306
306
  - - "~>"
307
307
  - !ruby/object:Gem::Version
308
- version: 0.18.5
308
+ version: 0.19.0
309
309
  - !ruby/object:Gem::Dependency
310
310
  name: simplecov-cobertura
311
311
  requirement: !ruby/object:Gem::Requirement
@@ -375,53 +375,97 @@ files:
375
375
  - Rakefile
376
376
  - app/assets/images/decidim/dummy.svg
377
377
  - app/assets/images/decidim/gamification/badges/test.svg
378
+ - app/commands/decidim/dummy_resources/create_dummy_resource.rb
378
379
  - app/controllers/decidim/dummy_resources/dummy_resources_controller.rb
379
380
  - app/forms/decidim/dummy_resources/dummy_resource_form.rb
381
+ - app/mailers/decidim/dummy_resources/dummy_resource_mailer.rb
380
382
  - app/views/decidim/dummy_resource/_linked_dummys.html.erb
381
383
  - app/views/decidim/dummy_resources/dummy_resources/foo.html.erb
382
384
  - app/views/decidim/dummy_resources/dummy_resources/show.html.erb
385
+ - config/locales/am-ET.yml
383
386
  - config/locales/ar-SA.yml
384
387
  - config/locales/ar.yml
388
+ - config/locales/bg-BG.yml
389
+ - config/locales/bg.yml
385
390
  - config/locales/ca.yml
386
391
  - config/locales/cs-CZ.yml
387
392
  - config/locales/cs.yml
393
+ - config/locales/da-DK.yml
394
+ - config/locales/da.yml
388
395
  - config/locales/de.yml
389
396
  - config/locales/el-GR.yml
390
397
  - config/locales/el.yml
391
398
  - config/locales/en.yml
392
399
  - config/locales/eo-UY.yml
400
+ - config/locales/eo.yml
393
401
  - config/locales/es-MX.yml
394
402
  - config/locales/es-PY.yml
395
403
  - config/locales/es.yml
404
+ - config/locales/et-EE.yml
405
+ - config/locales/et.yml
396
406
  - config/locales/eu.yml
397
407
  - config/locales/fi-pl.yml
398
408
  - config/locales/fi-plain.yml
399
409
  - config/locales/fi.yml
410
+ - config/locales/fr-CA.yml
400
411
  - config/locales/fr.yml
412
+ - config/locales/ga-IE.yml
401
413
  - config/locales/gl.yml
414
+ - config/locales/hr-HR.yml
415
+ - config/locales/hr.yml
402
416
  - config/locales/hu.yml
403
417
  - config/locales/id-ID.yml
404
418
  - config/locales/is-IS.yml
419
+ - config/locales/is.yml
405
420
  - config/locales/it.yml
421
+ - config/locales/ja-JP.yml
422
+ - config/locales/ja.yml
423
+ - config/locales/ko-KR.yml
424
+ - config/locales/ko.yml
425
+ - config/locales/lt-LT.yml
426
+ - config/locales/lt.yml
427
+ - config/locales/lv.yml
428
+ - config/locales/mt-MT.yml
429
+ - config/locales/mt.yml
406
430
  - config/locales/nl.yml
407
431
  - config/locales/no.yml
432
+ - config/locales/om-ET.yml
408
433
  - config/locales/pl.yml
409
434
  - config/locales/pt-BR.yml
410
435
  - config/locales/pt.yml
436
+ - config/locales/ro-RO.yml
411
437
  - config/locales/ru.yml
438
+ - config/locales/si-LK.yml
439
+ - config/locales/sk-SK.yml
440
+ - config/locales/sk.yml
441
+ - config/locales/sl.yml
442
+ - config/locales/so-SO.yml
443
+ - config/locales/sr-CS.yml
412
444
  - config/locales/sv.yml
445
+ - config/locales/sw-KE.yml
446
+ - config/locales/ti-ER.yml
413
447
  - config/locales/tr-TR.yml
414
448
  - config/locales/uk.yml
449
+ - config/locales/vi-VN.yml
450
+ - config/locales/vi.yml
451
+ - config/locales/zh-CN.yml
452
+ - config/locales/zh-TW.yml
415
453
  - lib/decidim/dev.rb
454
+ - lib/decidim/dev/assets/5000x5000.png
416
455
  - lib/decidim/dev/assets/Exampledocument.pdf
456
+ - lib/decidim/dev/assets/assemblies.json
457
+ - lib/decidim/dev/assets/assemblies_with_null.json
417
458
  - lib/decidim/dev/assets/avatar.jpg
418
459
  - lib/decidim/dev/assets/city.jpeg
419
460
  - lib/decidim/dev/assets/city2.jpeg
420
461
  - lib/decidim/dev/assets/city3.jpeg
421
462
  - lib/decidim/dev/assets/dni.jpg
463
+ - lib/decidim/dev/assets/geocoder_result_here.json
464
+ - lib/decidim/dev/assets/geocoder_result_osm.json
422
465
  - lib/decidim/dev/assets/icon.png
423
466
  - lib/decidim/dev/assets/id.jpg
424
467
  - lib/decidim/dev/assets/import_participatory_space_private_users.csv
468
+ - lib/decidim/dev/assets/import_participatory_space_private_users_nok.csv
425
469
  - lib/decidim/dev/assets/iso-8859-15.md
426
470
  - lib/decidim/dev/assets/malicious.jpg
427
471
  - lib/decidim/dev/assets/participatory_processes.json
@@ -431,6 +475,7 @@ files:
431
475
  - lib/decidim/dev/assets/participatory_text_wrong.odt
432
476
  - lib/decidim/dev/assets/verify_user_groups.csv
433
477
  - lib/decidim/dev/common_rake.rb
478
+ - lib/decidim/dev/dummy_translator.rb
434
479
  - lib/decidim/dev/railtie.rb
435
480
  - lib/decidim/dev/test/authorization_shared_examples.rb
436
481
  - lib/decidim/dev/test/base_spec_helper.rb
@@ -444,20 +489,23 @@ files:
444
489
  - lib/decidim/dev/test/rspec_support/authorization.rb
445
490
  - lib/decidim/dev/test/rspec_support/capybara.rb
446
491
  - lib/decidim/dev/test/rspec_support/capybara_data_picker.rb
447
- - lib/decidim/dev/test/rspec_support/capybara_proposals_picker.rb
448
492
  - lib/decidim/dev/test/rspec_support/capybara_scopes_picker.rb
449
493
  - lib/decidim/dev/test/rspec_support/comments.rb
450
494
  - lib/decidim/dev/test/rspec_support/component.rb
451
495
  - lib/decidim/dev/test/rspec_support/component_context.rb
496
+ - lib/decidim/dev/test/rspec_support/confirmation_helpers.rb
452
497
  - lib/decidim/dev/test/rspec_support/content_processing.rb
453
498
  - lib/decidim/dev/test/rspec_support/download_helper.rb
454
499
  - lib/decidim/dev/test/rspec_support/factory_bot.rb
500
+ - lib/decidim/dev/test/rspec_support/frontend.rb
455
501
  - lib/decidim/dev/test/rspec_support/gamification.rb
456
502
  - lib/decidim/dev/test/rspec_support/geocoder.rb
457
503
  - lib/decidim/dev/test/rspec_support/helpers.rb
458
504
  - lib/decidim/dev/test/rspec_support/html_matchers.rb
459
505
  - lib/decidim/dev/test/rspec_support/orderly_matchers.rb
506
+ - lib/decidim/dev/test/rspec_support/organization.rb
460
507
  - lib/decidim/dev/test/rspec_support/permissions_shared_examples.rb
508
+ - lib/decidim/dev/test/rspec_support/rake_tasks.rb
461
509
  - lib/decidim/dev/test/rspec_support/react_select.rb
462
510
  - lib/decidim/dev/test/rspec_support/route_helpers.rb
463
511
  - lib/decidim/dev/test/rspec_support/timezone.rb
@@ -473,7 +521,7 @@ homepage: https://github.com/decidim/decidim
473
521
  licenses:
474
522
  - AGPL-3.0
475
523
  metadata: {}
476
- post_install_message:
524
+ post_install_message:
477
525
  rdoc_options: []
478
526
  require_paths:
479
527
  - lib
@@ -481,15 +529,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
481
529
  requirements:
482
530
  - - ">="
483
531
  - !ruby/object:Gem::Version
484
- version: '2.5'
532
+ version: '2.6'
485
533
  required_rubygems_version: !ruby/object:Gem::Requirement
486
534
  requirements:
487
535
  - - ">="
488
536
  - !ruby/object:Gem::Version
489
537
  version: '0'
490
538
  requirements: []
491
- rubygems_version: 3.1.2
492
- signing_key:
539
+ rubygems_version: 3.0.3
540
+ signing_key:
493
541
  specification_version: 4
494
542
  summary: Decidim dev tools
495
543
  test_files: []
@@ -1,51 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "capybara_data_picker"
4
-
5
- module Capybara
6
- module ProposalsPicker
7
- include DataPicker
8
-
9
- RSpec::Matchers.define :have_data_picked do |expected, text|
10
- match do |data_picker|
11
- data_picker_elem = data_picker.data_picker
12
- expect(data_picker_elem).to have_selector(".picker-values div input[value='#{expected&.id || data_picker.global_value}']", visible: false)
13
- expect(data_picker_elem).to have_selector(:xpath, "//div[contains(@class,'picker-values')]/div/a[text()[contains(.,'#{text}')]]")
14
- end
15
- end
16
-
17
- def proposal_pick(proposal_picker, proposal)
18
- data_picker = proposal_picker.data_picker
19
- # use scope_repick to change single scope picker selected scope
20
- expect(data_picker).to have_selector(".picker-values:empty", visible: false) if data_picker.has_css?(".picker-single")
21
-
22
- expect(data_picker).to have_selector(".picker-prompt")
23
- data_picker.find(".picker-prompt").click
24
-
25
- proposal_picker_search_perform(proposal.title)
26
- proposal_picker_search_choose_result(proposal.id)
27
- data_picker_pick_current
28
-
29
- expect(proposal_picker).to have_data_picked(proposal, proposal.title)
30
- end
31
-
32
- private
33
-
34
- def proposal_picker_search_perform(term)
35
- body = find(:xpath, "//body")
36
- input_selector = "#data_picker-modal .picker-content input#data_picker-autocomplete"
37
- expect(body).to have_selector(input_selector)
38
- body.find("#data_picker-modal .picker-content").fill_in("data_picker-autocomplete", with: term)
39
- end
40
-
41
- def proposal_picker_search_choose_result(proposal_id)
42
- body = find(:xpath, "//body")
43
- expect(body).to have_selector(".autocomplete-suggestions .autocomplete-suggestion")
44
- body.find(".autocomplete-suggestions div.autocomplete-suggestion[data-model-id='#{proposal_id}']").click
45
- end
46
- end
47
- end
48
-
49
- RSpec.configure do |config|
50
- config.include Capybara::ProposalsPicker, type: :system
51
- end