decidim-dev 0.30.6 → 0.30.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 04fdb5e9f43124d9bb8d2c503b87d6d2d141180cfa0a885d1a37b0aec1f9e9e4
4
- data.tar.gz: 02bac4e2008bd261c26f0babaadfba054d2e8ab4d0293b4bf057e7f700e1b8dc
3
+ metadata.gz: 73891ab5db69a8ae4fff4416bc40bcbe68a72665e4f9d01dae292bd64150b23d
4
+ data.tar.gz: 76031524d4bbf3206d0ee286e6ab358656ee1e99f7f5242654c9b1431e245e47
5
5
  SHA512:
6
- metadata.gz: 7eea7dfc442380009ae41a6059d5b808274a4d3f85d7b036f8db13b55c1f65650e498aaeda8875bf3e41fd1ad0dfc3602fa1198ea541265256149e718983b0b4
7
- data.tar.gz: 53ef30b03e9bbf5b260cc82127cda85439effcb15cb08e363fa9349bced2f95869dc21b8c476d68831e177e2eeab84b050b87cdca65c9884763c09e04a2c15cf
6
+ metadata.gz: b4bcf8fc97603077c9a0abd2b0fa5a0883b3bd74ee4e51ac40b4a4122be12a04592beee18cdc400454a1f0f6678067f8e5adda52ce4311e0c33d6886bddaee3f
7
+ data.tar.gz: 3106aefb6e64f71206180de37c2c485fdf34b89b6f06fc54048aeafa4cc9da1a912156136c3ccb482e41cfc7fc6d24b3809c83e7a19a5cd56d1019138696f9fd
@@ -115,110 +115,102 @@ shared_context "when managing a component as a process admin" do
115
115
  end
116
116
  end
117
117
 
118
- shared_context "when publishing and unpublishing the component" do
118
+ shared_examples "add component resources to search index" do
119
119
  let(:title) { translated(current_component.name) }
120
- # When resources are being created or modified, the following jobs are enqueued among the ones that we need to wait for.
121
- # When running in CI, we have situations when job processing takes longer, causing flaky tests.
122
- # Adding a list of exceptions here, helps us to avoid those situations.
123
- let(:job_exceptions) do
124
- [
125
- Decidim::MachineTranslationResourceJob,
126
- ActiveStorage::AnalyzeJob
127
- ]
128
- end
129
-
130
- context "when component is unpublished" do
131
- before do
132
- current_component.unpublish!
133
- current_component.participatory_space.try_add_to_index_as_search_resource
134
-
135
- visit decidim_admin_participatory_processes.components_path(current_component.participatory_space)
136
- end
137
-
138
- it "reindexes on publication" do
139
- Decidim::SearchableResource.where(resource:).delete_all
140
- expect(Decidim::SearchableResource.where(resource:).count).to be_zero
141
120
 
142
- within "tr", text: title do
143
- click_on "Publish"
144
- end
121
+ before do
122
+ resource.reload.component.manifest.run_hooks(:unpublish, resource.reload.component)
123
+ visit decidim_admin_participatory_processes.components_path(resource.reload.component.participatory_space)
124
+ end
145
125
 
146
- expect(page).to have_admin_callout("The component has been successfully published")
126
+ around do |example|
127
+ perform_enqueued_jobs { example.run }
128
+ end
147
129
 
148
- perform_enqueued_jobs(except: job_exceptions)
130
+ it "adds records to index" do
131
+ expect(Decidim::SearchableResource.where(resource:).count).to be_zero
149
132
 
150
- expect(Decidim::SearchableResource.where(resource:).count).to be_positive
151
- expect(component.reload).to be_published
133
+ within "tr", text: title do
134
+ click_on "Publish"
152
135
  end
153
- end
154
136
 
155
- context "when component is published" do
156
- before do
157
- current_component.publish!
158
- current_component.participatory_space.try_add_to_index_as_search_resource
137
+ perform_enqueued_jobs
159
138
 
160
- visit decidim_admin_participatory_processes.components_path(current_component.participatory_space)
161
- end
139
+ expect(page).to have_admin_callout("The component has been successfully published")
162
140
 
163
- it "removes records from index" do
164
- perform_enqueued_jobs(except: job_exceptions)
141
+ expect(component.reload).to be_published
142
+ expect(resource.reload).to be_visible
143
+ expect(Decidim::SearchableResource.where(resource:).count).to be_positive
144
+ end
145
+ end
165
146
 
166
- expect(Decidim::SearchableResource.where(resource:).count).to be_positive
147
+ shared_examples "removes component resources from search index" do
148
+ let(:title) { translated(current_component.name) }
167
149
 
168
- within ".sidebar-menu" do
169
- click_on "Components"
170
- end
150
+ before do
151
+ resource.reload.component.manifest.run_hooks(:publish, resource.reload.component)
152
+ visit decidim_admin_participatory_processes.components_path(resource.reload.component.participatory_space)
153
+ end
171
154
 
172
- within "tr", text: title do
173
- click_on "Hide"
174
- end
155
+ around do |example|
156
+ perform_enqueued_jobs { example.run }
157
+ end
175
158
 
176
- perform_enqueued_jobs(except: job_exceptions)
159
+ it "removes records from index" do
160
+ expect(resource.reload.component).to be_published
161
+ expect(resource.component.participatory_space).to be_visible
162
+ expect(resource).to be_visible
163
+ expect(resource).to be_resource_visible
177
164
 
178
- expect(Decidim::SearchableResource.where(resource:).count).to be_positive
165
+ expect(Decidim::SearchableResource.where(resource:).count).to be_positive
179
166
 
180
- within "tr", text: title do
181
- click_on "Unpublish"
182
- end
167
+ within "tr", text: translated(current_component.name) do
168
+ click_on "Hide"
169
+ end
183
170
 
184
- expect(page).to have_admin_callout("The component has been successfully unpublished")
171
+ expect(component.reload).to be_published
172
+ expect(resource.reload).to be_visible
185
173
 
186
- perform_enqueued_jobs(except: job_exceptions)
174
+ expect(Decidim::SearchableResource.where(resource:).count).to be_positive
187
175
 
188
- expect(Decidim::SearchableResource.where(resource:).count).to be_zero
189
- expect(current_component.reload).not_to be_published
176
+ within "tr", text: translated(current_component.name) do
177
+ click_on "Unpublish"
190
178
  end
179
+
180
+ expect(page).to have_admin_callout("The component has been successfully unpublished")
181
+
182
+ expect(current_component.reload).not_to be_published
183
+ expect(resource.reload).not_to be_visible
184
+ expect(Decidim::SearchableResource.where(resource:).count).to be_zero
191
185
  end
192
186
  end
193
187
 
194
- shared_context "when cycling through publication states" do
195
- include_context "when managing a component as an admin" do
196
- let(:title) { translated(current_component.name) }
197
-
198
- it "cycles through unpublished and published states successfully" do
199
- visit decidim_admin_participatory_processes.components_path(current_component.participatory_space)
188
+ shared_examples "cycling through publication states" do
189
+ let(:title) { translated(current_component.name) }
200
190
 
201
- within ".sidebar-menu" do
202
- click_on "Components"
203
- end
191
+ it "works without raising errors" do
192
+ visit decidim_admin_participatory_processes.components_path(component.participatory_space)
204
193
 
205
- within "tr", text: title do
206
- click_on "Hide"
207
- end
194
+ within ".sidebar-menu" do
195
+ click_on "Components"
196
+ end
208
197
 
209
- expect(page).to have_admin_callout("The component has been successfully hidden from the menu.")
198
+ within "tr", text: title do
199
+ click_on "Hide"
200
+ end
210
201
 
211
- within "tr", text: title do
212
- click_on "Unpublish"
213
- end
202
+ expect(page).to have_admin_callout("The component has been successfully hidden from the menu.")
214
203
 
215
- expect(page).to have_admin_callout("The component has been successfully unpublished")
204
+ within "tr", text: title do
205
+ click_on "Unpublish"
206
+ end
216
207
 
217
- within "tr", text: title do
218
- click_on "Publish"
219
- end
208
+ expect(page).to have_admin_callout("The component has been successfully unpublished")
220
209
 
221
- expect(page).to have_admin_callout("The component has been successfully published")
210
+ within "tr", text: title do
211
+ click_on "Publish"
222
212
  end
213
+
214
+ expect(page).to have_admin_callout("The component has been successfully published")
223
215
  end
224
216
  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.30.6"
7
+ "0.30.7"
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.30.6
4
+ version: 0.30.7
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: 2026-02-26 00:00:00.000000000 Z
13
+ date: 2026-03-26 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: capybara
@@ -32,84 +32,84 @@ dependencies:
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 0.30.6
35
+ version: 0.30.7
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.30.6
42
+ version: 0.30.7
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: decidim-api
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - '='
48
48
  - !ruby/object:Gem::Version
49
- version: 0.30.6
49
+ version: 0.30.7
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - '='
55
55
  - !ruby/object:Gem::Version
56
- version: 0.30.6
56
+ version: 0.30.7
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: decidim-comments
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
61
  - - '='
62
62
  - !ruby/object:Gem::Version
63
- version: 0.30.6
63
+ version: 0.30.7
64
64
  type: :runtime
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
68
  - - '='
69
69
  - !ruby/object:Gem::Version
70
- version: 0.30.6
70
+ version: 0.30.7
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: decidim-core
73
73
  requirement: !ruby/object:Gem::Requirement
74
74
  requirements:
75
75
  - - '='
76
76
  - !ruby/object:Gem::Version
77
- version: 0.30.6
77
+ version: 0.30.7
78
78
  type: :runtime
79
79
  prerelease: false
80
80
  version_requirements: !ruby/object:Gem::Requirement
81
81
  requirements:
82
82
  - - '='
83
83
  - !ruby/object:Gem::Version
84
- version: 0.30.6
84
+ version: 0.30.7
85
85
  - !ruby/object:Gem::Dependency
86
86
  name: decidim-generators
87
87
  requirement: !ruby/object:Gem::Requirement
88
88
  requirements:
89
89
  - - '='
90
90
  - !ruby/object:Gem::Version
91
- version: 0.30.6
91
+ version: 0.30.7
92
92
  type: :runtime
93
93
  prerelease: false
94
94
  version_requirements: !ruby/object:Gem::Requirement
95
95
  requirements:
96
96
  - - '='
97
97
  - !ruby/object:Gem::Version
98
- version: 0.30.6
98
+ version: 0.30.7
99
99
  - !ruby/object:Gem::Dependency
100
100
  name: decidim-verifications
101
101
  requirement: !ruby/object:Gem::Requirement
102
102
  requirements:
103
103
  - - '='
104
104
  - !ruby/object:Gem::Version
105
- version: 0.30.6
105
+ version: 0.30.7
106
106
  type: :runtime
107
107
  prerelease: false
108
108
  version_requirements: !ruby/object:Gem::Requirement
109
109
  requirements:
110
110
  - - '='
111
111
  - !ruby/object:Gem::Version
112
- version: 0.30.6
112
+ version: 0.30.7
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: factory_bot_rails
115
115
  requirement: !ruby/object:Gem::Requirement