decidim-dev 0.28.6 → 0.29.0.rc1
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 +2 -2
- data/app/packs/stylesheets/decidim/dev/_accessibility.scss +1 -1
- data/app/packs/stylesheets/decidim/dev/_bullet.scss +4 -0
- data/app/packs/stylesheets/decidim/dev/_rack_profiler.scss +4 -0
- data/app/packs/stylesheets/decidim/dev.scss +2 -0
- data/config/locales/ar.yml +0 -3
- data/config/locales/ca.yml +0 -3
- data/config/locales/cs.yml +0 -3
- data/config/locales/de.yml +0 -3
- data/config/locales/en.yml +0 -3
- data/config/locales/es-MX.yml +0 -3
- data/config/locales/es-PY.yml +0 -3
- data/config/locales/es.yml +0 -3
- data/config/locales/eu.yml +3 -6
- data/config/locales/fi-plain.yml +0 -3
- data/config/locales/fi.yml +0 -3
- data/config/locales/fr-CA.yml +0 -3
- data/config/locales/fr.yml +0 -3
- data/config/locales/ja.yml +0 -3
- data/config/locales/ro-RO.yml +1 -1
- data/config/locales/sv.yml +8 -16
- data/config/rubocop/disabled.yml +60 -0
- data/config/rubocop/performance.yml +154 -0
- data/config/rubocop/rspec.yml +7 -2
- data/config/rubocop/ruby.yml +5 -5
- data/decidim-dev.gemspec +12 -9
- data/lib/decidim/dev/assets/assemblies.json +1 -34
- data/lib/decidim/dev/assets/assemblies_with_null.json +1 -2
- data/lib/decidim/dev/assets/participatory_processes.json +1 -34
- data/lib/decidim/dev/assets/participatory_processes_with_null.json +0 -1
- data/lib/decidim/dev/assets/participatory_text.md +0 -2
- data/lib/decidim/dev/component.rb +2 -3
- data/lib/decidim/dev/dummy_translator.rb +1 -1
- data/lib/decidim/dev/engine.rb +11 -0
- data/lib/decidim/dev/test/map_server.rb +125 -0
- data/lib/decidim/dev/test/rspec_support/attachment_helpers.rb +3 -1
- data/lib/decidim/dev/test/rspec_support/autocomplete_select.rb +2 -2
- data/lib/decidim/dev/test/rspec_support/bullet.rb +4 -0
- data/lib/decidim/dev/test/rspec_support/capybara.rb +18 -8
- data/lib/decidim/dev/test/rspec_support/cell_matchers.rb +1 -1
- data/lib/decidim/dev/test/rspec_support/component_context.rb +1 -1
- data/lib/decidim/dev/test/rspec_support/data_consent.rb +6 -6
- data/lib/decidim/dev/test/rspec_support/datepicker_date_fill.rb +25 -0
- data/lib/decidim/dev/test/rspec_support/datepicker_time_fill.rb +23 -0
- data/lib/decidim/dev/test/rspec_support/dynamic_attach.rb +2 -2
- data/lib/decidim/dev/test/rspec_support/geocoder.rb +8 -85
- data/lib/decidim/dev/test/rspec_support/helpers.rb +4 -4
- data/lib/decidim/dev/test/rspec_support/tom_select.rb +1 -1
- data/lib/decidim/dev/test/rspec_support/translation_helpers.rb +5 -6
- data/lib/decidim/dev/test/rspec_support/warden.rb +0 -1
- data/lib/decidim/dev/test/rspec_support/webmock.rb +7 -1
- data/lib/decidim/dev/test/rspec_support/wicked_pdf_assets_mock.rb +2 -2
- data/lib/decidim/dev/test/spec_helper.rb +2 -8
- data/lib/decidim/dev/version.rb +1 -1
- data/lib/decidim/dev.rb +0 -10
- data/lib/decidim-dev.rb +2 -0
- data/lib/tasks/lighthouse_report.rake +1 -1
- data/rubocop-decidim.yml +6 -0
- metadata +85 -46
- data/app/permissions/decidim/dev/permissions.rb +0 -22
- data/app/presenters/decidim/dev/dummy_resource_presenter.rb +0 -13
- data/config/locales/bn-BD.yml +0 -1
- data/config/locales/bs-BA.yml +0 -9
- data/config/locales/ca-IT.yml +0 -68
- data/lib/decidim/dev/assets/invalid_extension.log +0 -1
- data/lib/decidim/dev/assets/odt_file_reported_as.pdf +0 -0
- data/lib/decidim/dev/auth_engine.rb +0 -33
- data/lib/decidim/dev/test/rspec_support/activestorage_matchers.rb +0 -148
- /data/app/views/decidim/dummy_resource/{_linked_dummys.html.erb → _linked_dummies.html.erb} +0 -0
@@ -1,33 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "decidim/dev/needs_development_tools"
|
4
|
-
|
5
|
-
module Decidim
|
6
|
-
module Dev
|
7
|
-
# Example engine overriding the core authentication routes.
|
8
|
-
class AuthEngine < ::Rails::Engine
|
9
|
-
isolate_namespace Decidim::Dev
|
10
|
-
engine_name "decidim_dev_auth"
|
11
|
-
|
12
|
-
routes do
|
13
|
-
devise_scope :user do
|
14
|
-
match(
|
15
|
-
"/users/auth/test/callback",
|
16
|
-
to: "omniauth_callbacks#dev_callback",
|
17
|
-
as: "user_test_omniauth_authorize",
|
18
|
-
via: [:get, :post]
|
19
|
-
)
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
initializer "decidim_dev_auth.mount_test_routes", before: :add_routing_paths do
|
24
|
-
next unless Rails.env.test?
|
25
|
-
|
26
|
-
# Required for overriding the callback route.
|
27
|
-
Decidim::Core::Engine.routes.prepend do
|
28
|
-
mount Decidim::Dev::AuthEngine => "/"
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
@@ -1,148 +0,0 @@
|
|
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
|
File without changes
|