decidim-dev 0.28.1 → 0.28.3
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/app/models/decidim/dev/dummy_resource.rb +3 -1
- data/config/locales/bg.yml +9 -0
- data/config/locales/sv.yml +1 -1
- data/decidim-dev.gemspec +2 -0
- data/lib/decidim/dev/test/factories.rb +6 -0
- data/lib/decidim/dev/test/rspec_support/activestorage_matchers.rb +148 -0
- data/lib/decidim/dev/test/rspec_support/capybara.rb +2 -0
- data/lib/decidim/dev/test/rspec_support/dynamic_attach.rb +1 -1
- data/lib/decidim/dev/test/rspec_support/filters.rb +1 -1
- data/lib/decidim/dev/test/rspec_support/webmock.rb +1 -1
- data/lib/decidim/dev/test/spec_helper.rb +7 -0
- data/lib/decidim/dev/version.rb +1 -1
- data/lib/tasks/lighthouse_report.rake +2 -2
- metadata +37 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d6b9973be99a2087203195bd53e2d70c217f03e931d9dd65b41131175847f279
|
|
4
|
+
data.tar.gz: a11250967979f905fc8f477dddae1dcef632895fc3259657dd18b0ccc40883f4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1a845fc6a1a4228598a8b2c1f4f0b83e269075ad3433ebb9596c17c866650dccf9ddec58f233d3a8e2cdc0ee8232e583206370897c2b585a4b76d8896c2901e9
|
|
7
|
+
data.tar.gz: 75b487e53ab3b1b30918dc3adae0e3039d280c53963863145fbcdc49a3dc0c345948735cd4e1e9239dc4b2f5c09b3d8a4b8cbe09a775d436ff9980adaefb2a07
|
|
@@ -63,7 +63,9 @@ module Decidim
|
|
|
63
63
|
|
|
64
64
|
# Public: Whether the object can have new comments or not.
|
|
65
65
|
def user_allowed_to_comment?(user)
|
|
66
|
-
component.can_participate_in_space?(user)
|
|
66
|
+
return unless component.can_participate_in_space?(user)
|
|
67
|
+
|
|
68
|
+
ActionAuthorizer.new(user, "comment", component, self).authorize.ok?
|
|
67
69
|
end
|
|
68
70
|
|
|
69
71
|
# Public: Whether the object can have new comment votes or not.
|
data/config/locales/bg.yml
CHANGED
|
@@ -15,6 +15,12 @@ bg:
|
|
|
15
15
|
dummy:
|
|
16
16
|
settings:
|
|
17
17
|
global:
|
|
18
|
+
guided: Насочвано въвеждане
|
|
19
|
+
guided_help: Помощен текст
|
|
20
|
+
guided_readonly: Дезактивирано въвеждане
|
|
21
|
+
guided_rich: Насочвано широко въвеждане
|
|
22
|
+
guided_rich_help_html: HTML <strong>помощен</strong> текст
|
|
23
|
+
guided_rich_readonly_html: HTML <strong>помощен</strong> текст за дезакривирано въвеждане
|
|
18
24
|
readonly_attribute: Само за четене атрибут
|
|
19
25
|
test: А тест
|
|
20
26
|
test_choices:
|
|
@@ -23,6 +29,7 @@ bg:
|
|
|
23
29
|
c: В избор
|
|
24
30
|
test_options:
|
|
25
31
|
bar: Нещо1
|
|
32
|
+
baz: Baz
|
|
26
33
|
foo: Нещо2
|
|
27
34
|
step:
|
|
28
35
|
endorsements_blocked: Одобряване забранено
|
|
@@ -30,6 +37,7 @@ bg:
|
|
|
30
37
|
readonly_step_attribute: Само за четене стъпков атрибут
|
|
31
38
|
test_options:
|
|
32
39
|
bar: Нещо1
|
|
40
|
+
baz: Baz
|
|
33
41
|
foo: Нещо2
|
|
34
42
|
dummy:
|
|
35
43
|
admin:
|
|
@@ -45,6 +53,7 @@ bg:
|
|
|
45
53
|
description_own: Вие създадохте %{score} теста.
|
|
46
54
|
name: Тестове
|
|
47
55
|
next_level_in: Създайте още %{score} теста за да достигнете следващо ниво!
|
|
56
|
+
unearned_another: Този участник все още не е създал никакви тестове.
|
|
48
57
|
unearned_own: Вие все още не сте създали тест.
|
|
49
58
|
resource_links:
|
|
50
59
|
test_link:
|
data/config/locales/sv.yml
CHANGED
data/decidim-dev.gemspec
CHANGED
|
@@ -58,6 +58,8 @@ Gem::Specification.new do |s|
|
|
|
58
58
|
s.add_dependency "selenium-webdriver", "~> 4.9"
|
|
59
59
|
s.add_dependency "simplecov", "~> 0.22.0"
|
|
60
60
|
s.add_dependency "simplecov-cobertura", "~> 2.1.0"
|
|
61
|
+
s.add_dependency "spring", "~> 2.0"
|
|
62
|
+
s.add_dependency "spring-watcher-listen", "~> 2.0"
|
|
61
63
|
s.add_dependency "w3c_rspec_validators", "~> 0.3.0"
|
|
62
64
|
s.add_dependency "webmock", "~> 3.18"
|
|
63
65
|
s.add_dependency "wisper-rspec", "~> 1.0"
|
|
@@ -35,6 +35,12 @@ FactoryBot.define do
|
|
|
35
35
|
end
|
|
36
36
|
end
|
|
37
37
|
end
|
|
38
|
+
|
|
39
|
+
trait :moderated do
|
|
40
|
+
after(:create) do |resource, evaluator|
|
|
41
|
+
create(:moderation, reportable: resource, hidden_at: 2.days.ago, skip_injection: evaluator.skip_injection)
|
|
42
|
+
end
|
|
43
|
+
end
|
|
38
44
|
end
|
|
39
45
|
|
|
40
46
|
factory :nested_dummy_resource, class: "Decidim::Dev::NestedDummyResource" do
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module ActiveStorageMatchers
|
|
4
|
+
def be_blob_url(expected)
|
|
5
|
+
BeBlobUrl.new(expected)
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def include_blob_urls(*expected)
|
|
9
|
+
IncludeBlobUrls.new(expected)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
class BlobMatch
|
|
13
|
+
BLOB_URL_MATCHERS = {
|
|
14
|
+
redirect: %r{/rails/active_storage/blobs/redirect/([^/]+)/([^/]+)$},
|
|
15
|
+
representation: %r{/rails/active_storage/representations/redirect/([^/]+)/([^/]+)/([^/]+)$},
|
|
16
|
+
disk: %r{/rails/active_storage/disk/([^/]+)/([^/]+)$}
|
|
17
|
+
}.freeze
|
|
18
|
+
|
|
19
|
+
def initialize(url)
|
|
20
|
+
@url = url
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def blob
|
|
24
|
+
return unless key_match
|
|
25
|
+
|
|
26
|
+
@blob ||=
|
|
27
|
+
case url_type
|
|
28
|
+
when :redirect, :representation
|
|
29
|
+
ActiveStorage::Blob.find_signed(key_match)
|
|
30
|
+
when :disk
|
|
31
|
+
decoded = ActiveStorage.verifier.verified(key_match, purpose: :blob_key)
|
|
32
|
+
ActiveStorage::Blob.find_by(key: decoded[:key]) if decoded
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def variation
|
|
37
|
+
return unless variation_match
|
|
38
|
+
|
|
39
|
+
blob.representation(variation_match)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def key_match
|
|
43
|
+
return unless match
|
|
44
|
+
|
|
45
|
+
match[1]
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def variation_match
|
|
49
|
+
return unless match
|
|
50
|
+
|
|
51
|
+
match[2] if url_type == :representation
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def filename_match
|
|
55
|
+
return unless match
|
|
56
|
+
|
|
57
|
+
case url_type
|
|
58
|
+
when :representation
|
|
59
|
+
match[3]
|
|
60
|
+
else
|
|
61
|
+
match[2]
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
private
|
|
66
|
+
|
|
67
|
+
attr_reader :url, :url_type
|
|
68
|
+
|
|
69
|
+
def match
|
|
70
|
+
return @match if @url_type
|
|
71
|
+
|
|
72
|
+
@url_type = :none
|
|
73
|
+
@match = nil
|
|
74
|
+
BLOB_URL_MATCHERS.each do |type, matcher|
|
|
75
|
+
@match = url.match(matcher)
|
|
76
|
+
if @match
|
|
77
|
+
@url_type = type
|
|
78
|
+
break
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
@match
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
class BeBlobUrl
|
|
87
|
+
def initialize(expected)
|
|
88
|
+
@expected = expected
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
def description
|
|
92
|
+
"be a blob URL"
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
def matches?(actual)
|
|
96
|
+
@actual = actual
|
|
97
|
+
match = BlobMatch.new(actual)
|
|
98
|
+
match.blob == expected
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
def failure_message
|
|
102
|
+
"expected #{actual} to match blob with ID #{expected.id}"
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
def failure_message_when_negated
|
|
106
|
+
"expected #{actual} not to match blob with ID #{expected.id}"
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
private
|
|
110
|
+
|
|
111
|
+
attr_reader :expected, :actual
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
class IncludeBlobUrls
|
|
115
|
+
def initialize(expected)
|
|
116
|
+
@expected = expected
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
def description
|
|
120
|
+
"include blob URLs"
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
def matches?(actual)
|
|
124
|
+
@actual = actual
|
|
125
|
+
|
|
126
|
+
actual.all? do |url|
|
|
127
|
+
match = BlobMatch.new(url)
|
|
128
|
+
expected.include?(match.blob)
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
def failure_message
|
|
133
|
+
"expected #{actual.inspect} to match blobs with ID #{expected.map(&:id).join(", ")}"
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
def failure_message_when_negated
|
|
137
|
+
"expected #{actual.inspect} not to match blobs with ID #{expected.map(&:id).join(", ")}"
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
private
|
|
141
|
+
|
|
142
|
+
attr_reader :expected, :actual
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
RSpec.configure do |config|
|
|
147
|
+
config.include ActiveStorageMatchers
|
|
148
|
+
end
|
|
@@ -44,6 +44,7 @@ Capybara.register_driver :headless_chrome do |app|
|
|
|
44
44
|
options = Selenium::WebDriver::Chrome::Options.new
|
|
45
45
|
options.args << "--explicitly-allowed-ports=#{Capybara.server_port}"
|
|
46
46
|
options.args << "--headless=new"
|
|
47
|
+
options.args << "--disable-search-engine-choice-screen" # Prevents closing the window normally
|
|
47
48
|
# Do not limit browser resources
|
|
48
49
|
options.args << "--disable-dev-shm-usage"
|
|
49
50
|
options.args << "--no-sandbox"
|
|
@@ -121,6 +122,7 @@ end
|
|
|
121
122
|
Capybara.server = :puma, server_options
|
|
122
123
|
|
|
123
124
|
Capybara.server_errors = [SyntaxError, StandardError]
|
|
125
|
+
Capybara.save_path = Rails.root.join("tmp/screenshots")
|
|
124
126
|
|
|
125
127
|
Capybara.default_max_wait_time = 10
|
|
126
128
|
|
|
@@ -23,7 +23,7 @@ module Capybara
|
|
|
23
23
|
expect(page).to have_content(filename.first(12)) if front_interface
|
|
24
24
|
end
|
|
25
25
|
all(title_input(front_interface)).last.set(options[:title]) if options.has_key?(:title)
|
|
26
|
-
click_button(
|
|
26
|
+
click_button("Save") unless options[:keep_modal_open]
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
29
|
|
|
@@ -44,4 +44,11 @@ RSpec.configure do |config|
|
|
|
44
44
|
"img-src": %w(https://via.placeholder.com)
|
|
45
45
|
}
|
|
46
46
|
end
|
|
47
|
+
|
|
48
|
+
config.before do
|
|
49
|
+
# Ensure that the current host is not set for any spec in order to test that
|
|
50
|
+
# the automatic current host definition is working correctly in all
|
|
51
|
+
# situations.
|
|
52
|
+
ActiveStorage::Current.host = ""
|
|
53
|
+
end
|
|
47
54
|
end
|
data/lib/decidim/dev/version.rb
CHANGED
|
@@ -43,8 +43,8 @@ namespace :decidim do
|
|
|
43
43
|
def lighthouse_paths
|
|
44
44
|
["/"].tap do |urls|
|
|
45
45
|
urls << Decidim::ResourceLocatorPresenter.new(Decidim::ParticipatoryProcess.published.first).path
|
|
46
|
-
urls << Decidim::ResourceLocatorPresenter.new(Decidim::Meetings::Meeting.published.first).path
|
|
47
|
-
urls << Decidim::ResourceLocatorPresenter.new(Decidim::Proposals::Proposal.published.first).path
|
|
46
|
+
urls << Decidim::ResourceLocatorPresenter.new(Decidim::Meetings::Meeting.published.not_hidden.first).path
|
|
47
|
+
urls << Decidim::ResourceLocatorPresenter.new(Decidim::Proposals::Proposal.published.not_hidden.first).path
|
|
48
48
|
end
|
|
49
49
|
end
|
|
50
50
|
end
|
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.28.
|
|
4
|
+
version: 0.28.3
|
|
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: 2024-
|
|
13
|
+
date: 2024-09-10 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.28.
|
|
35
|
+
version: 0.28.3
|
|
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.28.
|
|
42
|
+
version: 0.28.3
|
|
43
43
|
- !ruby/object:Gem::Dependency
|
|
44
44
|
name: factory_bot_rails
|
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -374,6 +374,34 @@ dependencies:
|
|
|
374
374
|
- - "~>"
|
|
375
375
|
- !ruby/object:Gem::Version
|
|
376
376
|
version: 2.1.0
|
|
377
|
+
- !ruby/object:Gem::Dependency
|
|
378
|
+
name: spring
|
|
379
|
+
requirement: !ruby/object:Gem::Requirement
|
|
380
|
+
requirements:
|
|
381
|
+
- - "~>"
|
|
382
|
+
- !ruby/object:Gem::Version
|
|
383
|
+
version: '2.0'
|
|
384
|
+
type: :runtime
|
|
385
|
+
prerelease: false
|
|
386
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
387
|
+
requirements:
|
|
388
|
+
- - "~>"
|
|
389
|
+
- !ruby/object:Gem::Version
|
|
390
|
+
version: '2.0'
|
|
391
|
+
- !ruby/object:Gem::Dependency
|
|
392
|
+
name: spring-watcher-listen
|
|
393
|
+
requirement: !ruby/object:Gem::Requirement
|
|
394
|
+
requirements:
|
|
395
|
+
- - "~>"
|
|
396
|
+
- !ruby/object:Gem::Version
|
|
397
|
+
version: '2.0'
|
|
398
|
+
type: :runtime
|
|
399
|
+
prerelease: false
|
|
400
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
401
|
+
requirements:
|
|
402
|
+
- - "~>"
|
|
403
|
+
- !ruby/object:Gem::Version
|
|
404
|
+
version: '2.0'
|
|
377
405
|
- !ruby/object:Gem::Dependency
|
|
378
406
|
name: w3c_rspec_validators
|
|
379
407
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -607,6 +635,7 @@ files:
|
|
|
607
635
|
- lib/decidim/dev/test/rspec_support/accessibility_examples.rb
|
|
608
636
|
- lib/decidim/dev/test/rspec_support/action_mailer.rb
|
|
609
637
|
- lib/decidim/dev/test/rspec_support/active_job.rb
|
|
638
|
+
- lib/decidim/dev/test/rspec_support/activestorage_matchers.rb
|
|
610
639
|
- lib/decidim/dev/test/rspec_support/attachment_helpers.rb
|
|
611
640
|
- lib/decidim/dev/test/rspec_support/authorization.rb
|
|
612
641
|
- lib/decidim/dev/test/rspec_support/autocomplete_select.rb
|
|
@@ -669,7 +698,7 @@ metadata:
|
|
|
669
698
|
funding_uri: https://opencollective.com/decidim
|
|
670
699
|
homepage_uri: https://decidim.org
|
|
671
700
|
source_code_uri: https://github.com/decidim/decidim
|
|
672
|
-
post_install_message:
|
|
701
|
+
post_install_message:
|
|
673
702
|
rdoc_options: []
|
|
674
703
|
require_paths:
|
|
675
704
|
- lib
|
|
@@ -684,8 +713,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
684
713
|
- !ruby/object:Gem::Version
|
|
685
714
|
version: '0'
|
|
686
715
|
requirements: []
|
|
687
|
-
rubygems_version: 3.
|
|
688
|
-
signing_key:
|
|
716
|
+
rubygems_version: 3.3.7
|
|
717
|
+
signing_key:
|
|
689
718
|
specification_version: 4
|
|
690
719
|
summary: Decidim dev tools
|
|
691
720
|
test_files: []
|