decidim-dev 0.11.2 → 0.12.0.pre

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 21a627445f02c85f4d90532ee9efa46edb22419026f31ae46e93f431bafe482d
4
- data.tar.gz: 773305e802f532cf9065ddfc0b940c45ed26f61e34a9cde91f843771bf23f98e
3
+ metadata.gz: 91c18e11842b513d7ae1158a5528e92319682bede8d7ca74594b222a9d858e62
4
+ data.tar.gz: 334fb5eff6c9642376eabfdf5348383bba4eaf65cc0fd63f45e2e89371509e68
5
5
  SHA512:
6
- metadata.gz: 2112a0dbd6a9f1b738ff3fd6f74d5b82d05e2788702e84ea8da025cac171afb25107767d2ded7b982a4c02435e60949bca1348fab974ba4b6b487da30f0cfcaa
7
- data.tar.gz: f01cfbd9baa9efad2aa498b47df0d7b685ecc7469e7a9e1eee587c96dbace0653ef84601850c80072b755d176510ad903a652e13a248bbcbc3e8114719d37c1d
6
+ metadata.gz: 67e57882fc6a919d4c0ecccd70911125a3ebc2d9acf18811f2c70de0f97579fb7bbf7e4efb148484029753d9455b69c246c696c668803a686b11f864b85b3b44
7
+ data.tar.gz: 33e6a0940330f5175e2e86c452cabe51b63042c426f48d2f9e045ae06a31864d28814062c4003cac31af09307258510928342fbd14cb99821af9148c86721e12
@@ -5,8 +5,6 @@ module Decidim
5
5
  class DummyResourcesController < Decidim::Components::BaseController
6
6
  helper Decidim::Comments::CommentsHelper
7
7
 
8
- skip_authorization_check
9
-
10
8
  def show
11
9
  @commentable = DummyResources::DummyResource.find(params[:id])
12
10
  end
@@ -8,13 +8,17 @@ ca:
8
8
  title: Títol
9
9
  updated_at: Actualitzat el
10
10
  decidim:
11
- authorization_handlers:
12
- another_dummy_authorization_handler:
13
- name: Una altra autorització d'exemple
14
11
  dummy:
15
12
  admin:
16
13
  exports:
17
14
  dummies: Maniquins
15
+ pages:
16
+ home:
17
+ statistics:
18
+ bar: Bar
19
+ dummies_count_high: Fals alt
20
+ dummies_count_medium: Fals mitjà
21
+ foo: Foo
18
22
  participatory_processes:
19
23
  statistics:
20
24
  dummies_count_high: Prova alt
@@ -22,10 +26,3 @@ ca:
22
26
  resource_links:
23
27
  test_link:
24
28
  dummy_resource_dummy: Fictici relacionat
25
- pages:
26
- home:
27
- statistics:
28
- bar: Bar
29
- dummies_count_high: Prova alt
30
- dummies_count_medium: Prova mig
31
- foo: Foo
@@ -9,13 +9,17 @@ en:
9
9
  title: Title
10
10
  updated_at: Updated at
11
11
  decidim:
12
- authorization_handlers:
13
- another_dummy_authorization_handler:
14
- name: Another example authorization
15
12
  dummy:
16
13
  admin:
17
14
  exports:
18
15
  dummies: Dummies
16
+ pages:
17
+ home:
18
+ statistics:
19
+ bar: Bar
20
+ dummies_count_high: Dummies high
21
+ dummies_count_medium: Dummies medium
22
+ foo: Foo
19
23
  participatory_processes:
20
24
  statistics:
21
25
  dummies_count_high: Dummies high
@@ -23,10 +27,3 @@ en:
23
27
  resource_links:
24
28
  test_link:
25
29
  dummy_resource_dummy: Related dummy
26
- pages:
27
- home:
28
- statistics:
29
- bar: Bar
30
- dummies_count_high: Dummies high
31
- dummies_count_medium: Dummies medium
32
- foo: Foo
@@ -8,13 +8,17 @@ es:
8
8
  title: Título
9
9
  updated_at: Actualizado en
10
10
  decidim:
11
- authorization_handlers:
12
- another_dummy_authorization_handler:
13
- name: Otro ejemplo de autorización
14
11
  dummy:
15
12
  admin:
16
13
  exports:
17
14
  dummies: Maniquíes
15
+ pages:
16
+ home:
17
+ statistics:
18
+ bar: Bar
19
+ dummies_count_high: Falso alta
20
+ dummies_count_medium: Falso medium
21
+ foo: Foo
18
22
  participatory_processes:
19
23
  statistics:
20
24
  dummies_count_high: Dummies alta
@@ -22,10 +26,3 @@ es:
22
26
  resource_links:
23
27
  test_link:
24
28
  dummy_resource_dummy: Ficticio relacionado
25
- pages:
26
- home:
27
- statistics:
28
- bar: Bar
29
- dummies_count_high: Dummies alta
30
- dummies_count_medium: Dummies media
31
- foo: Foo
@@ -8,13 +8,17 @@ eu:
8
8
  title: Izenburua
9
9
  updated_at: Eguneratuta
10
10
  decidim:
11
- authorization_handlers:
12
- another_dummy_authorization_handler:
13
- name: Beste adibide bat baimena
14
11
  dummy:
15
12
  admin:
16
13
  exports:
17
14
  dummies: Manikiak
15
+ pages:
16
+ home:
17
+ statistics:
18
+ bar: Bar
19
+ dummies_count_high: Dummies altua
20
+ dummies_count_medium: Dummies ertainak
21
+ foo: foo
18
22
  participatory_processes:
19
23
  statistics:
20
24
  dummies_count_high: Dummies altua
@@ -22,10 +26,3 @@ eu:
22
26
  resource_links:
23
27
  test_link:
24
28
  dummy_resource_dummy: ' Honi buruzko adibidea '
25
- pages:
26
- home:
27
- statistics:
28
- bar: Bar
29
- dummies_count_high: Dummies altua
30
- dummies_count_medium: Dummies ertainak
31
- foo: foo
@@ -8,13 +8,17 @@ fi:
8
8
  title: otsikko
9
9
  updated_at: Päivitetty klo
10
10
  decidim:
11
- authorization_handlers:
12
- another_dummy_authorization_handler:
13
- name: Toinen esimerkki valtuutuksesta
14
11
  dummy:
15
12
  admin:
16
13
  exports:
17
14
  dummies: Esimerkkitiedot
15
+ pages:
16
+ home:
17
+ statistics:
18
+ bar: Palkki
19
+ dummies_count_high: Dummies korkea
20
+ dummies_count_medium: Dummies medium
21
+ foo: Foo
18
22
  participatory_processes:
19
23
  statistics:
20
24
  dummies_count_high: Esimerkkitilastojen korkein arvo
@@ -22,10 +26,3 @@ fi:
22
26
  resource_links:
23
27
  test_link:
24
28
  dummy_resource_dummy: Liittyvät esimerkkitiedot
25
- pages:
26
- home:
27
- statistics:
28
- bar: Palkki
29
- dummies_count_high: Esimerkkitilastojen korkein arvo
30
- dummies_count_medium: Esimerkkitilastojen keskimääräinen arvo
31
- foo: Foo
@@ -8,13 +8,17 @@ fr:
8
8
  title: Titre
9
9
  updated_at: Mis à jour à
10
10
  decidim:
11
- authorization_handlers:
12
- another_dummy_authorization_handler:
13
- name: Un autre exemple d'autorisation
14
11
  dummy:
15
12
  admin:
16
13
  exports:
17
14
  dummies: Nuls
15
+ pages:
16
+ home:
17
+ statistics:
18
+ bar: Machin
19
+ dummies_count_high: Dummies haute
20
+ dummies_count_medium: Dummies moyen
21
+ foo: Truc
18
22
  participatory_processes:
19
23
  statistics:
20
24
  dummies_count_high: Super nuls
@@ -22,10 +26,3 @@ fr:
22
26
  resource_links:
23
27
  test_link:
24
28
  dummy_resource_dummy: Référence factice concernée
25
- pages:
26
- home:
27
- statistics:
28
- bar: Machin
29
- dummies_count_high: Super nuls
30
- dummies_count_medium: Moyennement nuls
31
- foo: Truc
@@ -8,13 +8,17 @@ gl:
8
8
  title: Título
9
9
  updated_at: Actualizado en
10
10
  decidim:
11
- authorization_handlers:
12
- another_dummy_authorization_handler:
13
- name: Outra autorización de exemplo
14
11
  dummy:
15
12
  admin:
16
13
  exports:
17
14
  dummies: Dummies
15
+ pages:
16
+ home:
17
+ statistics:
18
+ bar: Bar
19
+ dummies_count_high: Maniquís de alta
20
+ dummies_count_medium: Dummies medio
21
+ foo: Foo
18
22
  participatory_processes:
19
23
  statistics:
20
24
  dummies_count_high: Maniquís de alta
@@ -22,10 +26,3 @@ gl:
22
26
  resource_links:
23
27
  test_link:
24
28
  dummy_resource_dummy: Dummy relacionado
25
- pages:
26
- home:
27
- statistics:
28
- bar: Bar
29
- dummies_count_high: Maniquís de alta
30
- dummies_count_medium: Dummies medio
31
- foo: Foo
@@ -8,13 +8,17 @@ it:
8
8
  title: Titolo
9
9
  updated_at: Aggiornato a
10
10
  decidim:
11
- authorization_handlers:
12
- another_dummy_authorization_handler:
13
- name: Un'altra autorizzazione di esempio
14
11
  dummy:
15
12
  admin:
16
13
  exports:
17
14
  dummies: Risorse Fittizie
15
+ pages:
16
+ home:
17
+ statistics:
18
+ bar: Bar
19
+ dummies_count_high: Manichini in alto
20
+ dummies_count_medium: Manichino medio
21
+ foo: foo
18
22
  participatory_processes:
19
23
  statistics:
20
24
  dummies_count_high: Manichini in alto
@@ -22,10 +26,3 @@ it:
22
26
  resource_links:
23
27
  test_link:
24
28
  dummy_resource_dummy: Risorse fittizie correlate
25
- pages:
26
- home:
27
- statistics:
28
- bar: Bar
29
- dummies_count_high: Manichini in alto
30
- dummies_count_medium: Manichino medio
31
- foo: foo
@@ -8,13 +8,17 @@ nl:
8
8
  title: Titel
9
9
  updated_at: Bijgewerkt op
10
10
  decidim:
11
- authorization_handlers:
12
- another_dummy_authorization_handler:
13
- name: Een ander voorbeeld van goedkeuring
14
11
  dummy:
15
12
  admin:
16
13
  exports:
17
14
  dummies: Dummies
15
+ pages:
16
+ home:
17
+ statistics:
18
+ bar: Bar
19
+ dummies_count_high: Dummies hoog
20
+ dummies_count_medium: Dummies medium
21
+ foo: Foo
18
22
  participatory_processes:
19
23
  statistics:
20
24
  dummies_count_high: Dummies hoog
@@ -22,10 +26,3 @@ nl:
22
26
  resource_links:
23
27
  test_link:
24
28
  dummy_resource_dummy: Gerelateerde dummy
25
- pages:
26
- home:
27
- statistics:
28
- bar: Bar
29
- dummies_count_high: Dummies hoog
30
- dummies_count_medium: Dummies medium
31
- foo: Foo
@@ -8,13 +8,17 @@ pl:
8
8
  title: Tytuł
9
9
  updated_at: Zaktualizowano na
10
10
  decidim:
11
- authorization_handlers:
12
- another_dummy_authorization_handler:
13
- name: Kolejna przykładowa autoryzacja
14
11
  dummy:
15
12
  admin:
16
13
  exports:
17
14
  dummies: Manekiny
15
+ pages:
16
+ home:
17
+ statistics:
18
+ bar: Bar
19
+ dummies_count_high: Atrapy wysokie
20
+ dummies_count_medium: Średni manekin
21
+ foo: bla
18
22
  participatory_processes:
19
23
  statistics:
20
24
  dummies_count_high: Atrapy wysokie
@@ -22,10 +26,3 @@ pl:
22
26
  resource_links:
23
27
  test_link:
24
28
  dummy_resource_dummy: Podobne manekina
25
- pages:
26
- home:
27
- statistics:
28
- bar: Bar
29
- dummies_count_high: Atrapy wysokie
30
- dummies_count_medium: Średni manekin
31
- foo: bla
@@ -8,13 +8,17 @@ pt-BR:
8
8
  title: Título
9
9
  updated_at: Atualizado em
10
10
  decidim:
11
- authorization_handlers:
12
- another_dummy_authorization_handler:
13
- name: Outro exemplo de autorização
14
11
  dummy:
15
12
  admin:
16
13
  exports:
17
14
  dummies: Manequim
15
+ pages:
16
+ home:
17
+ statistics:
18
+ bar: Bar
19
+ dummies_count_high: Dummies alta
20
+ dummies_count_medium: Dummies medium
21
+ foo: Foo
18
22
  participatory_processes:
19
23
  statistics:
20
24
  dummies_count_high: Dummies alta
@@ -22,10 +26,3 @@ pt-BR:
22
26
  resource_links:
23
27
  test_link:
24
28
  dummy_resource_dummy: Manequim relacionado
25
- pages:
26
- home:
27
- statistics:
28
- bar: Bar
29
- dummies_count_high: Dummies alta
30
- dummies_count_medium: Dummies médio
31
- foo: Foo
@@ -8,13 +8,17 @@ pt:
8
8
  title: Título
9
9
  updated_at: Atualizado em
10
10
  decidim:
11
- authorization_handlers:
12
- another_dummy_authorization_handler:
13
- name: Outro exemplo de autorização
14
11
  dummy:
15
12
  admin:
16
13
  exports:
17
14
  dummies: Manequim
15
+ pages:
16
+ home:
17
+ statistics:
18
+ bar: Barra
19
+ dummies_count_high: Dummies alta
20
+ dummies_count_medium: Dummies medium
21
+ foo: Foo
18
22
  participatory_processes:
19
23
  statistics:
20
24
  dummies_count_high: Dummies alta
@@ -22,10 +26,3 @@ pt:
22
26
  resource_links:
23
27
  test_link:
24
28
  dummy_resource_dummy: Manequim relacionado
25
- pages:
26
- home:
27
- statistics:
28
- bar: Barra
29
- dummies_count_high: Dummies alta
30
- dummies_count_medium: Dummies médio
31
- foo: Foo
@@ -12,6 +12,13 @@ ru:
12
12
  admin:
13
13
  exports:
14
14
  dummies: Примеры сохранения
15
+ pages:
16
+ home:
17
+ statistics:
18
+ bar: Пример переменной 1
19
+ dummies_count_high: Пример наибольшего количества
20
+ dummies_count_medium: Пример среднего количества
21
+ foo: Пример переменной 2
15
22
  participatory_processes:
16
23
  statistics:
17
24
  dummies_count_high: Пример наибольшего количества
@@ -19,10 +26,3 @@ ru:
19
26
  resource_links:
20
27
  test_link:
21
28
  dummy_resource_dummy: Пример соотносящегося ресурса
22
- pages:
23
- home:
24
- statistics:
25
- bar: Пример переменной 1
26
- dummies_count_high: Пример наибольшего количества
27
- dummies_count_medium: Пример среднего количества
28
- foo: Пример переменной 2
@@ -8,13 +8,17 @@ sv:
8
8
  title: Titel
9
9
  updated_at: Uppdaterad på
10
10
  decidim:
11
- authorization_handlers:
12
- another_dummy_authorization_handler:
13
- name: Ett annat exempel godkännande
14
11
  dummy:
15
12
  admin:
16
13
  exports:
17
14
  dummies: Dummies
15
+ pages:
16
+ home:
17
+ statistics:
18
+ bar: Bar
19
+ dummies_count_high: Dummies höga
20
+ dummies_count_medium: Dummies medium
21
+ foo: Foo
18
22
  participatory_processes:
19
23
  statistics:
20
24
  dummies_count_high: Dummies höga
@@ -22,10 +26,3 @@ sv:
22
26
  resource_links:
23
27
  test_link:
24
28
  dummy_resource_dummy: Relaterad dummy
25
- pages:
26
- home:
27
- statistics:
28
- bar: Bar
29
- dummies_count_high: Dummies höga
30
- dummies_count_medium: Dummies medium
31
- foo: Foo
@@ -8,13 +8,17 @@ uk:
8
8
  title: Назва
9
9
  updated_at: 'Оновлено:'
10
10
  decidim:
11
- authorization_handlers:
12
- another_dummy_authorization_handler:
13
- name: Ще один приклад підтвердження особи
14
11
  dummy:
15
12
  admin:
16
13
  exports:
17
14
  dummies: Приклади збереження
15
+ pages:
16
+ home:
17
+ statistics:
18
+ bar: Приклад змінної 1
19
+ dummies_count_high: Приклад найвищої кількості
20
+ dummies_count_medium: Приклад середньої кількості
21
+ foo: Приклад змінної 2
18
22
  participatory_processes:
19
23
  statistics:
20
24
  dummies_count_high: Приклад найвищої кількості
@@ -22,10 +26,3 @@ uk:
22
26
  resource_links:
23
27
  test_link:
24
28
  dummy_resource_dummy: Приклад пов'язаного ресурсу
25
- pages:
26
- home:
27
- statistics:
28
- bar: Приклад змінної 1
29
- dummies_count_high: Приклад найвищої кількості
30
- dummies_count_medium: Приклад середньої кількості
31
- foo: Приклад змінної 2
@@ -4,17 +4,9 @@ require "decidim/dev"
4
4
 
5
5
  ENV["RAILS_ENV"] ||= "test"
6
6
 
7
- root_path = File.expand_path("..", Dir.pwd)
8
7
  engine_spec_dir = File.join(Dir.pwd, "spec")
9
8
 
10
- if ENV["SIMPLECOV"]
11
- require "simplecov/no_defaults"
12
-
13
- SimpleCov.root(root_path)
14
- require "simplecov/defaults"
15
-
16
- SimpleCov.command_name File.basename(Dir.pwd)
17
- end
9
+ require "simplecov" if ENV["SIMPLECOV"]
18
10
 
19
11
  require "decidim/core"
20
12
  require "decidim/core/test"
@@ -0,0 +1,111 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActionDispatch
4
+ module SystemTesting
5
+ module TestHelpers
6
+ # Screenshot helper for system testing.
7
+ module ScreenshotHelper
8
+ # Takes a screenshot of the current page in the browser.
9
+ #
10
+ # +take_screenshot+ can be used at any point in your system tests to take
11
+ # a screenshot of the current state. This can be useful for debugging or
12
+ # automating visual testing.
13
+ #
14
+ # The screenshot will be displayed in your console, if supported.
15
+ #
16
+ # You can set the +RAILS_SYSTEM_TESTING_SCREENSHOT+ environment variable to
17
+ # control the output. Possible values are:
18
+ # * [+simple+ (default)] Only displays the screenshot path.
19
+ # This is the default value.
20
+ # * [+inline+] Display the screenshot in the terminal using the
21
+ # iTerm image protocol (https://iterm2.com/documentation-images.html).
22
+ # * [+artifact+] Display the screenshot in the terminal, using the terminal
23
+ # artifact format (https://buildkite.github.io/terminal/inline-images/).
24
+ def take_screenshot
25
+ save_image
26
+ save_page
27
+ STDOUT.puts display_screenshot
28
+ end
29
+
30
+ # Takes a screenshot of the current page in the browser if the test
31
+ # failed.
32
+ #
33
+ # +take_failed_screenshot+ is included in <tt>application_system_test_case.rb</tt>
34
+ # that is generated with the application. To take screenshots when a test
35
+ # fails add +take_failed_screenshot+ to the teardown block before clearing
36
+ # sessions.
37
+ def take_failed_screenshot
38
+ take_screenshot if failed? && supports_screenshot?
39
+ end
40
+
41
+ private
42
+
43
+ def screenshot_name
44
+ failed? ? "failures_#{method_name}" : method_name
45
+ end
46
+
47
+ def image_path
48
+ @image_path ||= absolute_image_path.to_s
49
+ end
50
+
51
+ def page_path
52
+ @page_path ||= absolute_page_path.to_s
53
+ end
54
+
55
+ def absolute_image_path
56
+ Rails.root.join("tmp/screenshots/#{screenshot_name}.png")
57
+ end
58
+
59
+ def absolute_page_path
60
+ Rails.root.join("tmp/screenshots/#{screenshot_name}.html")
61
+ end
62
+
63
+ def save_image
64
+ page.save_screenshot(absolute_image_path)
65
+ end
66
+
67
+ def save_page
68
+ page.save_page(absolute_page_path)
69
+ end
70
+
71
+ def output_type
72
+ # Environment variables have priority
73
+ output_type = ENV["RAILS_SYSTEM_TESTING_SCREENSHOT"] || ENV["CAPYBARA_INLINE_SCREENSHOT"]
74
+
75
+ # Default to outputting a path to the screenshot
76
+ output_type ||= "simple"
77
+
78
+ output_type
79
+ end
80
+
81
+ def display_screenshot
82
+ message = "[Image screenshot]: file://#{image_path}\n"
83
+ message += " [Page HTML]: file://#{page_path}\n"
84
+
85
+ case output_type
86
+ when "artifact"
87
+ message << "\e]1338;url=artifact://#{absolute_image_path}\a\n"
88
+ when "inline"
89
+ name = inline_base64(File.basename(absolute_image_path))
90
+ image = inline_base64(File.read(absolute_image_path))
91
+ message << "\e]1337;File=name=#{name};height=400px;inline=1:#{image}\a\n"
92
+ end
93
+
94
+ message
95
+ end
96
+
97
+ def inline_base64(path)
98
+ Base64.strict_encode64(path)
99
+ end
100
+
101
+ def failed?
102
+ !passed? && !skipped?
103
+ end
104
+
105
+ def supports_screenshot?
106
+ Capybara.current_driver != :rack_test
107
+ end
108
+ end
109
+ end
110
+ end
111
+ end
@@ -31,6 +31,8 @@ Capybara.register_driver :headless_chrome do |app|
31
31
  )
32
32
  end
33
33
 
34
+ Capybara.server = :puma, { Silent: true }
35
+
34
36
  Capybara.asset_host = "http://localhost:3000"
35
37
 
36
38
  Capybara.server_errors = [SyntaxError, StandardError]
@@ -47,6 +47,15 @@ module Decidim
47
47
  include Followable
48
48
  include Traceable
49
49
  include Publicable
50
+ include Searchable
51
+
52
+ searchable_fields(
53
+ scope_id: { scope: :id },
54
+ participatory_space: { component: :participatory_space },
55
+ A: [:title],
56
+ D: [:address],
57
+ datetime: :published_at
58
+ )
50
59
 
51
60
  component_manifest_name "dummy"
52
61
 
@@ -88,7 +97,7 @@ Decidim.register_component(:dummy) do |component|
88
97
  settings.attribute :dummy_step_attribute_2, type: :boolean
89
98
  end
90
99
 
91
- component.register_resource do |resource|
100
+ component.register_resource(:dummy_resource) do |resource|
92
101
  resource.name = :dummy
93
102
  resource.model_class_name = "Decidim::DummyResources::DummyResource"
94
103
  resource.template = "decidim/dummy_resource/linked_dummys"
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ shared_examples "permission is not set" do
4
+ it "raises an error" do
5
+ expect { subject }.to raise_error(Decidim::PermissionAction::PermissionNotSetError)
6
+ end
7
+ end
8
+
9
+ shared_examples "delegates permissions to" do |delegated_class|
10
+ it "delegates the check to the #{delegated_class.name} permissions class" do
11
+ delegated_permissions = instance_double(delegated_class, permissions: :foo)
12
+ delegated_permission_action = instance_double(Decidim::PermissionAction, allowed?: true)
13
+
14
+ allow(delegated_class)
15
+ .to receive(:new)
16
+ .with(user, permission_action, context)
17
+ .and_return delegated_permissions
18
+
19
+ expect(delegated_permissions)
20
+ .to receive(:permissions)
21
+ .and_return(delegated_permission_action)
22
+
23
+ subject
24
+ end
25
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Adapted from https://github.com/JedWatson/react-select/issues/832#issuecomment-276441836
4
+
5
+ module Capybara
6
+ module ReactSelect
7
+ def autocomplete_select(value, from:)
8
+ within("div[data-autocomplete-for='#{from}']") do
9
+ find(".Select-control").click
10
+
11
+ find(".Select .Select-input input").native.send_keys(value[0..4])
12
+ expect(page).to have_css(".Select-menu-outer") # select should be open now
13
+
14
+ # This is a little funky because when the entered text forces the select to
15
+ # wrap, it causes React to re-render. We need to get it to re-render
16
+ # (if needed) by hovering.
17
+ expect(page).to have_css(".Select-option", text: value)
18
+ find(".Select-option", text: value).hover
19
+ expect(page).to have_css(".Select-option", text: value)
20
+ find(".Select-option", text: value).click
21
+ expect(page).to have_css(".Select-value-label", text: value)
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module ScreenshotHelperExt
5
+ def self.included(_base)
6
+ require_relative "ext/screenshot_helper"
7
+ end
8
+ end
9
+ end
@@ -5,12 +5,12 @@ require "rspec/rails"
5
5
  require "rspec/cells"
6
6
  require "factory_bot_rails"
7
7
  require "byebug"
8
- require "cancan/matchers"
9
8
  require "rectify/rspec"
10
9
  require "wisper/rspec/stub_wisper_publisher"
11
10
  require "db-query-matchers"
12
11
  require "action_view/helpers/sanitize_helper"
13
12
  require_relative "factories"
13
+ require_relative "screenshot_helper_ext"
14
14
 
15
15
  # Requires supporting files with custom matchers and macros, etc,
16
16
  # in ./rspec_support/ and its subdirectories.
@@ -35,4 +35,6 @@ RSpec.configure do |config|
35
35
  config.include Rectify::RSpec::Helpers
36
36
  config.include ActionView::Helpers::SanitizeHelper
37
37
  config.include ERB::Util
38
+ config.include Capybara::ReactSelect, type: :system
39
+ config.include Decidim::ScreenshotHelperExt, type: :system
38
40
  end
@@ -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.11.2"
7
+ "0.12.0.pre"
8
8
  end
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-dev
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.2
4
+ version: 0.12.0.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josep Jaume Rey Peroy
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2018-06-13 00:00:00.000000000 Z
13
+ date: 2018-06-06 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: capybara
@@ -18,28 +18,28 @@ dependencies:
18
18
  requirements:
19
19
  - - "~>"
20
20
  - !ruby/object:Gem::Version
21
- version: '2.15'
21
+ version: '3.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - "~>"
27
27
  - !ruby/object:Gem::Version
28
- version: '2.15'
28
+ version: '3.0'
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: decidim
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 0.11.2
35
+ version: 0.12.0.pre
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.11.2
42
+ version: 0.12.0.pre
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: factory_bot_rails
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -110,6 +110,20 @@ dependencies:
110
110
  - - "~>"
111
111
  - !ruby/object:Gem::Version
112
112
  version: 0.9.18
113
+ - !ruby/object:Gem::Dependency
114
+ name: mdl
115
+ requirement: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - "~>"
118
+ - !ruby/object:Gem::Version
119
+ version: 0.4.0
120
+ type: :runtime
121
+ prerelease: false
122
+ version_requirements: !ruby/object:Gem::Requirement
123
+ requirements:
124
+ - - "~>"
125
+ - !ruby/object:Gem::Version
126
+ version: 0.4.0
113
127
  - !ruby/object:Gem::Dependency
114
128
  name: nokogiri
115
129
  requirement: !ruby/object:Gem::Requirement
@@ -130,6 +144,20 @@ dependencies:
130
144
  - - ">="
131
145
  - !ruby/object:Gem::Version
132
146
  version: 1.8.2
147
+ - !ruby/object:Gem::Dependency
148
+ name: puma
149
+ requirement: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - "~>"
152
+ - !ruby/object:Gem::Version
153
+ version: '3.11'
154
+ type: :runtime
155
+ prerelease: false
156
+ version_requirements: !ruby/object:Gem::Requirement
157
+ requirements:
158
+ - - "~>"
159
+ - !ruby/object:Gem::Version
160
+ version: '3.11'
133
161
  - !ruby/object:Gem::Dependency
134
162
  name: rails-controller-testing
135
163
  requirement: !ruby/object:Gem::Requirement
@@ -329,6 +357,7 @@ files:
329
357
  - lib/decidim/dev/railtie.rb
330
358
  - lib/decidim/dev/test/authorization_shared_examples.rb
331
359
  - lib/decidim/dev/test/base_spec_helper.rb
360
+ - lib/decidim/dev/test/ext/screenshot_helper.rb
332
361
  - lib/decidim/dev/test/factories.rb
333
362
  - lib/decidim/dev/test/promoted_participatory_processes_shared_examples.rb
334
363
  - lib/decidim/dev/test/rspec_support/action_mailer.rb
@@ -349,11 +378,14 @@ files:
349
378
  - lib/decidim/dev/test/rspec_support/helpers.rb
350
379
  - lib/decidim/dev/test/rspec_support/html_matchers.rb
351
380
  - lib/decidim/dev/test/rspec_support/orderly_matchers.rb
381
+ - lib/decidim/dev/test/rspec_support/permissions_shared_examples.rb
382
+ - lib/decidim/dev/test/rspec_support/react_select.rb
352
383
  - lib/decidim/dev/test/rspec_support/route_helpers.rb
353
384
  - lib/decidim/dev/test/rspec_support/translation_helpers.rb
354
385
  - lib/decidim/dev/test/rspec_support/warden.rb
355
386
  - lib/decidim/dev/test/rspec_support/webmock.rb
356
387
  - lib/decidim/dev/test/rspec_support/wisper.rb
388
+ - lib/decidim/dev/test/screenshot_helper_ext.rb
357
389
  - lib/decidim/dev/test/spec_helper.rb
358
390
  - lib/decidim/dev/version.rb
359
391
  - lib/tasks/generators.rake
@@ -373,9 +405,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
373
405
  version: '2.3'
374
406
  required_rubygems_version: !ruby/object:Gem::Requirement
375
407
  requirements:
376
- - - ">="
408
+ - - ">"
377
409
  - !ruby/object:Gem::Version
378
- version: '0'
410
+ version: 1.3.1
379
411
  requirements: []
380
412
  rubyforge_project:
381
413
  rubygems_version: 2.7.6