decidim-dev 0.2.0 → 0.3.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/it.yml +9 -0
- data/lib/decidim/dev.rb +1 -8
- data/lib/decidim/dev/railtie.rb +1 -1
- data/lib/decidim/dev/test/base_spec_helper.rb +6 -4
- data/lib/decidim/dev/test/rspec_support/capybara.rb +2 -2
- data/lib/decidim/dev/test/rspec_support/feature.rb +4 -2
- data/lib/decidim/dev/test/rspec_support/feature_context.rb +28 -8
- data/lib/decidim/dev/test/rspec_support/translation_helpers.rb +7 -2
- data/lib/decidim/dev/test/spec_helper.rb +2 -2
- data/lib/generators/decidim/dummy_generator.rb +1 -1
- metadata +27 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a88fadf13615c56bd5b7a212f9eda57c4987fa6e
|
4
|
+
data.tar.gz: 650719667b612f7180b45eb65f7f21db74efcefe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0607cd5a6027281c0d7c222a484963d44ca2b3fbd2adcb83873c8af8b13bd2eb30e85ff0831793fe3d666a63b239bb84d976765a976456b8854b40b9a38ca8f6
|
7
|
+
data.tar.gz: 48e6aacad6145e4d1ea194ef047a8d52529e323c6cb3ba2198267fe598da56b834b5b2005b12f8784c5f0416c4cf445275fcade83e2db468b994f55a96a6dcfa
|
data/lib/decidim/dev.rb
CHANGED
@@ -12,14 +12,7 @@ module Decidim
|
|
12
12
|
#
|
13
13
|
# Returns a String with the path for a particular asset.
|
14
14
|
def self.asset(name)
|
15
|
-
File.expand_path(
|
16
|
-
File.join(
|
17
|
-
File.dirname(__FILE__),
|
18
|
-
"dev",
|
19
|
-
"assets",
|
20
|
-
name
|
21
|
-
)
|
22
|
-
)
|
15
|
+
File.expand_path(File.join(__dir__, "dev", "assets", name))
|
23
16
|
end
|
24
17
|
end
|
25
18
|
end
|
data/lib/decidim/dev/railtie.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
ENV["RAILS_ENV"] ||= "test"
|
4
4
|
|
5
|
-
root_path = File.
|
5
|
+
root_path = File.expand_path("..", Dir.pwd)
|
6
6
|
engine_spec_dir = File.join(Dir.pwd, "spec")
|
7
7
|
dummy_app_path = File.expand_path(File.join(root_path, "spec", "decidim_dummy_app"))
|
8
8
|
|
@@ -22,15 +22,17 @@ if ENV["SIMPLECOV"]
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
|
26
|
-
|
25
|
+
if ENV["CI"]
|
26
|
+
require "codecov"
|
27
|
+
SimpleCov.formatter = SimpleCov::Formatter::Codecov
|
28
|
+
end
|
27
29
|
end
|
28
30
|
|
29
31
|
require "rails"
|
30
32
|
require "active_support/core_ext/string"
|
31
33
|
require "decidim/core"
|
32
34
|
require "decidim/core/test"
|
33
|
-
require "#{
|
35
|
+
require "#{__dir__}/rspec_support/feature.rb"
|
34
36
|
|
35
37
|
begin
|
36
38
|
require "#{dummy_app_path}/config/environment"
|
@@ -24,10 +24,10 @@ end
|
|
24
24
|
capybara_options = {
|
25
25
|
extensions: [
|
26
26
|
File.expand_path(
|
27
|
-
File.join(
|
27
|
+
File.join(__dir__, "phantomjs_polyfills", "promise.js")
|
28
28
|
),
|
29
29
|
File.expand_path(
|
30
|
-
File.join(
|
30
|
+
File.join(__dir__, "phantomjs_polyfills", "phantomjs-shim.js")
|
31
31
|
)
|
32
32
|
],
|
33
33
|
js_errors: true,
|
@@ -27,12 +27,13 @@ module Decidim
|
|
27
27
|
include Resourceable
|
28
28
|
include Reportable
|
29
29
|
include Authorable
|
30
|
+
include HasCategory
|
30
31
|
include Decidim::Comments::Commentable
|
31
32
|
|
32
33
|
feature_manifest_name "dummy"
|
33
34
|
|
34
|
-
def
|
35
|
-
|
35
|
+
def reported_content_url
|
36
|
+
ResourceLocatorPresenter.new(self).url
|
36
37
|
end
|
37
38
|
end
|
38
39
|
|
@@ -110,6 +111,7 @@ RSpec.configure do |config|
|
|
110
111
|
|
111
112
|
t.references :decidim_feature, index: true
|
112
113
|
t.references :decidim_author, index: true
|
114
|
+
t.references :decidim_category, index: true
|
113
115
|
|
114
116
|
t.timestamps
|
115
117
|
end
|
@@ -1,9 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
RSpec.shared_context "feature" do
|
4
|
-
let!(:manifest_name) { raise NotImplementedError }
|
5
4
|
let(:manifest) { Decidim.find_feature_manifest(manifest_name) }
|
6
5
|
|
6
|
+
let(:user) { create :user, :confirmed, organization: organization }
|
7
|
+
|
7
8
|
let!(:organization) { create(:organization) }
|
8
9
|
|
9
10
|
let(:participatory_process) do
|
@@ -16,6 +17,10 @@ RSpec.shared_context "feature" do
|
|
16
17
|
participatory_process: participatory_process)
|
17
18
|
end
|
18
19
|
|
20
|
+
let!(:category) { create :category, participatory_process: participatory_process }
|
21
|
+
|
22
|
+
let!(:scope) { create :scope, organization: organization }
|
23
|
+
|
19
24
|
before do
|
20
25
|
switch_to_host(organization.host)
|
21
26
|
end
|
@@ -27,19 +32,34 @@ end
|
|
27
32
|
|
28
33
|
RSpec.shared_context "feature admin" do
|
29
34
|
include_context "feature"
|
30
|
-
let(:user) { create(:user, :confirmed, organization: organization) }
|
31
35
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
36
|
+
let(:current_feature) { feature }
|
37
|
+
|
38
|
+
let(:user) do
|
39
|
+
create :user,
|
40
|
+
:admin,
|
41
|
+
:confirmed,
|
42
|
+
organization: organization
|
43
|
+
end
|
38
44
|
|
45
|
+
before do
|
39
46
|
login_as user, scope: :user
|
47
|
+
visit_feature_admin
|
40
48
|
end
|
41
49
|
|
42
50
|
def visit_feature_admin
|
43
51
|
visit decidim_admin.manage_feature_path(participatory_process, feature)
|
44
52
|
end
|
45
53
|
end
|
54
|
+
|
55
|
+
RSpec.shared_context "feature process admin" do
|
56
|
+
include_context "feature admin"
|
57
|
+
|
58
|
+
let(:user) do
|
59
|
+
create :user,
|
60
|
+
:process_admin,
|
61
|
+
:confirmed,
|
62
|
+
organization: organization,
|
63
|
+
participatory_process: participatory_process
|
64
|
+
end
|
65
|
+
end
|
@@ -16,8 +16,13 @@ module TranslationHelpers
|
|
16
16
|
#
|
17
17
|
# field - the field that holds the translations
|
18
18
|
# locale - the ID of the locale to check
|
19
|
-
|
20
|
-
|
19
|
+
# upcase - a boolean to indicate whether the string must be checked upcased or not.
|
20
|
+
#
|
21
|
+
# rubocop:disable Style/PredicateName
|
22
|
+
def have_i18n_content(field, locale: I18n.locale, upcase: false)
|
23
|
+
content = stripped(translated(field, locale: locale))
|
24
|
+
content = content.upcase if upcase
|
25
|
+
have_content(content)
|
21
26
|
end
|
22
27
|
|
23
28
|
# Handles how to fill in i18n form fields.
|
@@ -19,11 +19,11 @@ require "db-query-matchers"
|
|
19
19
|
|
20
20
|
# Requires supporting files with custom matchers and macros, etc,
|
21
21
|
# in ./support/ and its subdirectories.
|
22
|
-
Dir["#{
|
22
|
+
Dir["#{__dir__}/rspec_support/**/*.rb"].each { |f| require f }
|
23
23
|
|
24
24
|
RSpec.configure do |config|
|
25
25
|
config.color = true
|
26
|
-
config.fail_fast = ENV["FAIL_FAST"]
|
26
|
+
config.fail_fast = ENV["FAIL_FAST"] == "true"
|
27
27
|
config.infer_spec_type_from_file_location!
|
28
28
|
config.mock_with :rspec
|
29
29
|
config.raise_errors_for_deprecations!
|
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.3.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-06-
|
13
|
+
date: 2017-06-16 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.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: 0.
|
28
|
+
version: 0.3.0
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: factory_girl_rails
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
@@ -89,6 +89,9 @@ dependencies:
|
|
89
89
|
- - "~>"
|
90
90
|
- !ruby/object:Gem::Version
|
91
91
|
version: '3.5'
|
92
|
+
- - "<"
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '3.6'
|
92
95
|
type: :runtime
|
93
96
|
prerelease: false
|
94
97
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -96,6 +99,9 @@ dependencies:
|
|
96
99
|
- - "~>"
|
97
100
|
- !ruby/object:Gem::Version
|
98
101
|
version: '3.5'
|
102
|
+
- - "<"
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '3.6'
|
99
105
|
- !ruby/object:Gem::Dependency
|
100
106
|
name: rspec-repeat
|
101
107
|
requirement: !ruby/object:Gem::Requirement
|
@@ -256,14 +262,14 @@ dependencies:
|
|
256
262
|
requirements:
|
257
263
|
- - "~>"
|
258
264
|
- !ruby/object:Gem::Version
|
259
|
-
version: 0.
|
265
|
+
version: 0.48.1
|
260
266
|
type: :runtime
|
261
267
|
prerelease: false
|
262
268
|
version_requirements: !ruby/object:Gem::Requirement
|
263
269
|
requirements:
|
264
270
|
- - "~>"
|
265
271
|
- !ruby/object:Gem::Version
|
266
|
-
version: 0.
|
272
|
+
version: 0.48.1
|
267
273
|
- !ruby/object:Gem::Dependency
|
268
274
|
name: db-query-matchers
|
269
275
|
requirement: !ruby/object:Gem::Requirement
|
@@ -320,6 +326,20 @@ dependencies:
|
|
320
326
|
- - "~>"
|
321
327
|
- !ruby/object:Gem::Version
|
322
328
|
version: 3.0.1
|
329
|
+
- !ruby/object:Gem::Dependency
|
330
|
+
name: puma
|
331
|
+
requirement: !ruby/object:Gem::Requirement
|
332
|
+
requirements:
|
333
|
+
- - "~>"
|
334
|
+
- !ruby/object:Gem::Version
|
335
|
+
version: 3.8.2
|
336
|
+
type: :runtime
|
337
|
+
prerelease: false
|
338
|
+
version_requirements: !ruby/object:Gem::Requirement
|
339
|
+
requirements:
|
340
|
+
- - "~>"
|
341
|
+
- !ruby/object:Gem::Version
|
342
|
+
version: 3.8.2
|
323
343
|
description: Utilities and tools we need to develop Decidim
|
324
344
|
email:
|
325
345
|
- josepjaume@gmail.com
|
@@ -340,6 +360,7 @@ files:
|
|
340
360
|
- config/locales/eu.yml
|
341
361
|
- config/locales/fi.yml
|
342
362
|
- config/locales/fr.yml
|
363
|
+
- config/locales/it.yml
|
343
364
|
- config/locales/nl.yml
|
344
365
|
- lib/decidim/dev.rb
|
345
366
|
- lib/decidim/dev/assets/Exampledocument.docx
|