decidim-dev 0.5.1 → 0.6.0
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 +4 -4
- data/config/locales/ca.yml +2 -1
- data/config/locales/en.yml +2 -1
- data/config/locales/es.yml +2 -1
- data/config/locales/eu.yml +1 -1
- data/config/locales/fi.yml +5 -1
- data/config/locales/fr.yml +4 -0
- data/config/locales/it.yml +1 -1
- data/config/locales/nl.yml +4 -0
- data/config/locales/pl.yml +4 -1
- data/config/locales/uk.yml +9 -0
- data/lib/decidim/dev/test/promoted_participatory_processes_shared_examples.rb +58 -0
- data/lib/decidim/dev/test/rspec_support/feature.rb +6 -8
- data/lib/decidim/dev/test/rspec_support/feature_context.rb +3 -3
- data/lib/decidim/dev/test/spec_helper.rb +1 -0
- data/lib/tasks/locale_checker.rake +11 -11
- metadata +16 -22
- data/config/i18n-tasks.yml +0 -6
- data/lib/decidim/dev/test/i18n_shared_examples.rb +0 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5fcec34b9e3326c82e1fd21f747ac9c512a93e1
|
4
|
+
data.tar.gz: 3a5454b2b66e730cbbd9ef52a49e9f4aa81961ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 155c8491f7c2f3c019b1b03d5ae57560d09a445bd0a7d591b861c9d2b98242b7f0daf5995a7ef010ebeb6dd88a10783b2a5b05fb4cd3909ad548eba7cb9bbd70
|
7
|
+
data.tar.gz: 7199c58b5414234338ac34a9749ce903dea7fdd66caf9fc7e3355caf2ace6bd2570dfd9925ad1118cf0811fbeb8f6c0aaa07c649498474b4689d34e0fd85559b
|
data/config/locales/ca.yml
CHANGED
data/config/locales/en.yml
CHANGED
data/config/locales/es.yml
CHANGED
data/config/locales/eu.yml
CHANGED
data/config/locales/fi.yml
CHANGED
data/config/locales/fr.yml
CHANGED
data/config/locales/it.yml
CHANGED
data/config/locales/nl.yml
CHANGED
data/config/locales/pl.yml
CHANGED
@@ -0,0 +1,58 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
shared_examples "with promoted participatory processes" do
|
4
|
+
before do
|
5
|
+
@request.env["decidim.current_organization"] = organization
|
6
|
+
end
|
7
|
+
|
8
|
+
describe "promoted_participatory_processes" do
|
9
|
+
it "orders them by active_step end_date" do
|
10
|
+
create(
|
11
|
+
:participatory_process,
|
12
|
+
:with_steps,
|
13
|
+
:unpublished,
|
14
|
+
:promoted,
|
15
|
+
organization: organization
|
16
|
+
)
|
17
|
+
|
18
|
+
create(
|
19
|
+
:participatory_process,
|
20
|
+
:with_steps,
|
21
|
+
:unpublished,
|
22
|
+
organization: organization
|
23
|
+
)
|
24
|
+
|
25
|
+
last = create(
|
26
|
+
:participatory_process,
|
27
|
+
:with_steps,
|
28
|
+
:published,
|
29
|
+
:promoted,
|
30
|
+
organization: organization
|
31
|
+
)
|
32
|
+
last.active_step.update_attribute(:end_date, nil)
|
33
|
+
|
34
|
+
first = create(
|
35
|
+
:participatory_process,
|
36
|
+
:with_steps,
|
37
|
+
:published,
|
38
|
+
:promoted,
|
39
|
+
organization: organization,
|
40
|
+
end_date: Time.current.advance(days: 10)
|
41
|
+
)
|
42
|
+
first.active_step.update_attribute(:end_date, Time.current.advance(days: 2))
|
43
|
+
|
44
|
+
second = create(
|
45
|
+
:participatory_process,
|
46
|
+
:with_steps,
|
47
|
+
:published,
|
48
|
+
:promoted,
|
49
|
+
organization: organization,
|
50
|
+
end_date: Time.current.advance(days: 8)
|
51
|
+
)
|
52
|
+
second.active_step.update_attribute(:end_date, Time.current.advance(days: 4))
|
53
|
+
|
54
|
+
expect(controller.helpers.promoted_participatory_processes)
|
55
|
+
.to match_array([first, second, last])
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -22,6 +22,11 @@ module Decidim
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
+
class DummyResourceEvent < Events::BaseEvent
|
26
|
+
include Decidim::Events::EmailEvent
|
27
|
+
include Decidim::Events::NotificationEvent
|
28
|
+
end
|
29
|
+
|
25
30
|
class DummyResource < ActiveRecord::Base
|
26
31
|
include HasFeature
|
27
32
|
include Resourceable
|
@@ -30,20 +35,13 @@ module Decidim
|
|
30
35
|
include HasCategory
|
31
36
|
include HasScope
|
32
37
|
include Decidim::Comments::Commentable
|
38
|
+
include Followable
|
33
39
|
|
34
40
|
feature_manifest_name "dummy"
|
35
41
|
|
36
42
|
def reported_content_url
|
37
43
|
ResourceLocatorPresenter.new(self).url
|
38
44
|
end
|
39
|
-
|
40
|
-
def notifiable?(_context)
|
41
|
-
true
|
42
|
-
end
|
43
|
-
|
44
|
-
def users_to_notify
|
45
|
-
[author]
|
46
|
-
end
|
47
45
|
end
|
48
46
|
|
49
47
|
class DummyResourcesController < ActionController::Base
|
@@ -14,10 +14,10 @@ shared_context "feature" do
|
|
14
14
|
let!(:feature) do
|
15
15
|
create(:feature,
|
16
16
|
manifest: manifest,
|
17
|
-
|
17
|
+
participatory_space: participatory_process)
|
18
18
|
end
|
19
19
|
|
20
|
-
let!(:category) { create :category,
|
20
|
+
let!(:category) { create :category, participatory_space: participatory_process }
|
21
21
|
|
22
22
|
let!(:scope) { create :scope, organization: organization }
|
23
23
|
|
@@ -57,7 +57,7 @@ shared_context "feature admin" do
|
|
57
57
|
#
|
58
58
|
# Returns a url.
|
59
59
|
def edit_feature_path(feature)
|
60
|
-
|
60
|
+
Decidim::EngineRouter.admin_proxy(feature.participatory_space).edit_feature_path(feature.id)
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
@@ -26,6 +26,7 @@ RSpec.configure do |config|
|
|
26
26
|
config.fail_fast = ENV["FAIL_FAST"] == "true"
|
27
27
|
config.infer_spec_type_from_file_location!
|
28
28
|
config.mock_with :rspec
|
29
|
+
config.order = :random
|
29
30
|
config.raise_errors_for_deprecations!
|
30
31
|
|
31
32
|
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
@@ -2,19 +2,19 @@
|
|
2
2
|
|
3
3
|
namespace :decidim do
|
4
4
|
desc "Allows a decidim installation to check whether its locales are complete"
|
5
|
-
task :
|
6
|
-
|
7
|
-
"BUNDLE_GEMFILE" => File.expand_path("Gemfile"),
|
8
|
-
"ENFORCED_LOCALES" => Decidim.available_locales.join(",")
|
9
|
-
}
|
5
|
+
task check_locales: :environment do
|
6
|
+
FileUtils.remove_dir("tmp/decidim_repo", true)
|
10
7
|
|
11
|
-
|
12
|
-
|
8
|
+
branch = ENV["TARGET_BRANCH"] || "master"
|
9
|
+
status = system("git clone --depth=1 --single-branch --branch #{branch} https://github.com/decidim/decidim tmp/decidim_repo")
|
10
|
+
return unless status
|
13
11
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
12
|
+
Dir.chdir("tmp/decidim_repo") do
|
13
|
+
env = { "ENFORCED_LOCALES" => Decidim.available_locales.join(",") }
|
14
|
+
|
15
|
+
Bundler.with_clean_env do
|
16
|
+
system(env, "bundle install")
|
17
|
+
system(env, "bundle exec rspec spec/i18n_spec.rb")
|
18
18
|
end
|
19
19
|
end
|
20
20
|
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.
|
4
|
+
version: 0.6.0
|
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: 2017-
|
13
|
+
date: 2017-09-15 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: decidim
|
@@ -18,14 +18,14 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - '='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.
|
21
|
+
version: 0.6.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: 0.
|
28
|
+
version: 0.6.0
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: factory_girl_rails
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
@@ -60,14 +60,14 @@ dependencies:
|
|
60
60
|
requirements:
|
61
61
|
- - "~>"
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version: 2.
|
63
|
+
version: 2.15.0
|
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: 2.
|
70
|
+
version: 2.15.0
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
72
|
name: capybara-screenshot
|
73
73
|
requirement: !ruby/object:Gem::Requirement
|
@@ -88,20 +88,14 @@ dependencies:
|
|
88
88
|
requirements:
|
89
89
|
- - "~>"
|
90
90
|
- !ruby/object:Gem::Version
|
91
|
-
version:
|
92
|
-
- - "<"
|
93
|
-
- !ruby/object:Gem::Version
|
94
|
-
version: '3.6'
|
91
|
+
version: 3.6.1
|
95
92
|
type: :runtime
|
96
93
|
prerelease: false
|
97
94
|
version_requirements: !ruby/object:Gem::Requirement
|
98
95
|
requirements:
|
99
96
|
- - "~>"
|
100
97
|
- !ruby/object:Gem::Version
|
101
|
-
version:
|
102
|
-
- - "<"
|
103
|
-
- !ruby/object:Gem::Version
|
104
|
-
version: '3.6'
|
98
|
+
version: 3.6.1
|
105
99
|
- !ruby/object:Gem::Dependency
|
106
100
|
name: rspec-repeat
|
107
101
|
requirement: !ruby/object:Gem::Requirement
|
@@ -178,14 +172,14 @@ dependencies:
|
|
178
172
|
requirements:
|
179
173
|
- - '='
|
180
174
|
- !ruby/object:Gem::Version
|
181
|
-
version: 0.9.
|
175
|
+
version: 0.9.18
|
182
176
|
type: :runtime
|
183
177
|
prerelease: false
|
184
178
|
version_requirements: !ruby/object:Gem::Requirement
|
185
179
|
requirements:
|
186
180
|
- - '='
|
187
181
|
- !ruby/object:Gem::Version
|
188
|
-
version: 0.9.
|
182
|
+
version: 0.9.18
|
189
183
|
- !ruby/object:Gem::Dependency
|
190
184
|
name: faker
|
191
185
|
requirement: !ruby/object:Gem::Requirement
|
@@ -206,14 +200,14 @@ dependencies:
|
|
206
200
|
requirements:
|
207
201
|
- - "~>"
|
208
202
|
- !ruby/object:Gem::Version
|
209
|
-
version: 1.
|
203
|
+
version: 1.16.0
|
210
204
|
type: :runtime
|
211
205
|
prerelease: false
|
212
206
|
version_requirements: !ruby/object:Gem::Requirement
|
213
207
|
requirements:
|
214
208
|
- - "~>"
|
215
209
|
- !ruby/object:Gem::Version
|
216
|
-
version: 1.
|
210
|
+
version: 1.16.0
|
217
211
|
- !ruby/object:Gem::Dependency
|
218
212
|
name: rails-controller-testing
|
219
213
|
requirement: !ruby/object:Gem::Requirement
|
@@ -262,14 +256,14 @@ dependencies:
|
|
262
256
|
requirements:
|
263
257
|
- - "~>"
|
264
258
|
- !ruby/object:Gem::Version
|
265
|
-
version: 0.
|
259
|
+
version: 0.49.1
|
266
260
|
type: :runtime
|
267
261
|
prerelease: false
|
268
262
|
version_requirements: !ruby/object:Gem::Requirement
|
269
263
|
requirements:
|
270
264
|
- - "~>"
|
271
265
|
- !ruby/object:Gem::Version
|
272
|
-
version: 0.
|
266
|
+
version: 0.49.1
|
273
267
|
- !ruby/object:Gem::Dependency
|
274
268
|
name: db-query-matchers
|
275
269
|
requirement: !ruby/object:Gem::Requirement
|
@@ -339,7 +333,6 @@ files:
|
|
339
333
|
- Rakefile
|
340
334
|
- app/assets/images/decidim/dummy.svg
|
341
335
|
- app/views/decidim/dummy_resource/_linked_dummys.html.erb
|
342
|
-
- config/i18n-tasks.yml
|
343
336
|
- config/locales/ca.yml
|
344
337
|
- config/locales/en.yml
|
345
338
|
- config/locales/es.yml
|
@@ -349,6 +342,7 @@ files:
|
|
349
342
|
- config/locales/it.yml
|
350
343
|
- config/locales/nl.yml
|
351
344
|
- config/locales/pl.yml
|
345
|
+
- config/locales/uk.yml
|
352
346
|
- lib/decidim/dev.rb
|
353
347
|
- lib/decidim/dev/assets/Exampledocument.pdf
|
354
348
|
- lib/decidim/dev/assets/avatar.jpg
|
@@ -362,7 +356,7 @@ files:
|
|
362
356
|
- lib/decidim/dev/railtie.rb
|
363
357
|
- lib/decidim/dev/test/authorization_shared_examples.rb
|
364
358
|
- lib/decidim/dev/test/base_spec_helper.rb
|
365
|
-
- lib/decidim/dev/test/
|
359
|
+
- lib/decidim/dev/test/promoted_participatory_processes_shared_examples.rb
|
366
360
|
- lib/decidim/dev/test/rspec_support/action_mailer.rb
|
367
361
|
- lib/decidim/dev/test/rspec_support/active_job.rb
|
368
362
|
- lib/decidim/dev/test/rspec_support/attachments.rb
|
data/config/i18n-tasks.yml
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "i18n/tasks"
|
4
|
-
|
5
|
-
shared_examples_for "I18n sanity" do
|
6
|
-
let(:locales) do
|
7
|
-
ENV["ENFORCED_LOCALES"].present? ? ENV["ENFORCED_LOCALES"].split(",") : [:en]
|
8
|
-
end
|
9
|
-
|
10
|
-
let(:i18n) { I18n::Tasks::BaseTask.new(locales: locales) }
|
11
|
-
let(:missing_keys) { i18n.missing_keys }
|
12
|
-
let(:unused_keys) { i18n.unused_keys }
|
13
|
-
|
14
|
-
it "does not have missing keys" do
|
15
|
-
expect(missing_keys).to be_empty, "#{missing_keys.inspect} are missing"
|
16
|
-
end
|
17
|
-
|
18
|
-
it "does not have unused keys" do
|
19
|
-
expect(unused_keys).to be_empty, "#{unused_keys.inspect} are unused"
|
20
|
-
end
|
21
|
-
|
22
|
-
it "is normalized" do
|
23
|
-
previous_locale_hashes = locale_hashes
|
24
|
-
i18n.normalize_store!
|
25
|
-
new_locale_hashes = locale_hashes
|
26
|
-
|
27
|
-
expect(previous_locale_hashes).to eq(new_locale_hashes),
|
28
|
-
"Please normalize your locale files with `i18n-tasks normalize`"
|
29
|
-
end
|
30
|
-
|
31
|
-
def locale_hashes
|
32
|
-
Dir.glob("config/locales/**/*.yml").inject({}) do |results, file|
|
33
|
-
md5 = Digest::MD5.file(file).hexdigest
|
34
|
-
results.merge(file => md5)
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|