decidim 0.0.7 → 0.0.8.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of decidim might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.circleci/config.yml +67 -0
- data/.eslintignore +1 -1
- data/.eslintrc.json +1 -0
- data/.travis.yml +4 -1
- data/Gemfile.lock +49 -48
- data/README.md +44 -118
- data/Rakefile +9 -13
- data/decidim-admin/README.md +2 -2
- data/decidim-admin/app/assets/javascripts/decidim/admin/application.js.es6 +13 -0
- data/decidim-admin/app/assets/javascripts/decidim/admin/toggle_nav.js.es6 +17 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/_decidim.scss +0 -1
- data/decidim-admin/app/assets/stylesheets/decidim/admin/modules/_datepicker.scss +224 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/modules/_modules.scss +1 -0
- data/decidim-admin/app/controllers/decidim/admin/newsletters_controller.rb +1 -1
- data/decidim-admin/app/forms/decidim/admin/participatory_process_user_role_form.rb +9 -0
- data/decidim-admin/app/helpers/decidim/admin/application_helper.rb +6 -0
- data/decidim-admin/app/views/decidim/admin/categories/index.html.erb +1 -1
- data/decidim-admin/app/views/decidim/admin/participatory_process_groups/index.html.erb +1 -1
- data/decidim-admin/app/views/decidim/admin/participatory_process_user_roles/_form.html.erb +2 -3
- data/decidim-admin/app/views/decidim/admin/participatory_process_user_roles/index.html.erb +1 -1
- data/decidim-admin/app/views/decidim/admin/static_pages/index.html.erb +2 -2
- data/decidim-admin/app/views/layouts/decidim/admin/_application.html.erb +2 -1
- data/decidim-admin/app/views/layouts/decidim/admin/pages.html.erb +1 -1
- data/decidim-admin/config/i18n-tasks.yml +2 -0
- data/decidim-admin/config/locales/ca.yml +22 -17
- data/decidim-admin/config/locales/en.yml +22 -17
- data/decidim-admin/config/locales/es.yml +23 -18
- data/decidim-admin/config/locales/eu.yml +0 -19
- data/decidim-admin/config/locales/fi.yml +0 -14
- data/decidim-admin/config/locales/fr.yml +141 -0
- data/decidim-admin/config/locales/nl.yml +5 -0
- data/decidim-admin/spec/features/admin_invite_spec.rb +7 -1
- data/decidim-admin/spec/features/admin_manages_organization_spec.rb +1 -1
- data/decidim-admin/spec/features/admin_manages_participatory_process_groups_spec.rb +1 -1
- data/decidim-admin/spec/features/admin_manages_participatory_processes_spec.rb +1 -1
- data/decidim-admin/spec/features/static_pages_spec.rb +0 -5
- data/decidim-admin/spec/forms/organization_form_spec.rb +6 -1
- data/decidim-admin/spec/shared/manage_process_admins_examples.rb +2 -2
- data/decidim-admin/spec/shared/manage_process_steps_examples.rb +21 -17
- data/decidim-admin/spec/shared/manage_processes_examples.rb +13 -10
- data/decidim-admin/spec/shared/participatory_admin_shared_context.rb +3 -3
- data/decidim-admin/vendor/assets/javascripts/moment.min.js +7 -0
- data/decidim-api/README.md +2 -2
- data/decidim-budgets/README.md +2 -2
- data/decidim-budgets/config/locales/ca.yml +3 -3
- data/decidim-budgets/config/locales/en.yml +3 -3
- data/decidim-budgets/config/locales/es.yml +3 -3
- data/decidim-budgets/config/locales/eu.yml +0 -3
- data/decidim-budgets/config/locales/fi.yml +0 -3
- data/decidim-budgets/config/locales/fr.yml +97 -0
- data/decidim-budgets/config/locales/nl.yml +5 -0
- data/decidim-budgets/db/migrate/20170410074214_remove_not_null_reference_budgets.rb +5 -0
- data/decidim-budgets/spec/shared/manage_projects_examples.rb +1 -1
- data/decidim-comments/README.md +2 -2
- data/decidim-comments/app/assets/javascripts/decidim/comments/bundle.js +0 -0
- data/decidim-comments/config/locales/fr.yml +5 -0
- data/decidim-comments/config/locales/nl.yml +5 -0
- data/decidim-dev/README.md +2 -2
- data/decidim-dev/config/locales/fr.yml +5 -0
- data/decidim-dev/config/locales/nl.yml +5 -0
- data/decidim-dev/lib/decidim/dev.rb +8 -5
- data/decidim-dev/lib/decidim/dev/common_rake.rb +1 -23
- data/decidim-dev/lib/decidim/dev/railtie.rb +13 -0
- data/decidim-dev/lib/decidim/dev/test/base_spec_helper.rb +6 -5
- data/decidim-dev/lib/generators/decidim/dummy_generator.rb +13 -16
- data/decidim-dev/lib/tasks/test_app.rake +18 -0
- data/decidim-meetings/README.md +2 -2
- data/decidim-meetings/app/controllers/decidim/meetings/meeting_widgets_controller.rb +21 -0
- data/decidim-meetings/app/controllers/decidim/meetings/meetings_controller.rb +2 -0
- data/decidim-meetings/app/views/decidim/meetings/meeting_widgets/.erb +16 -0
- data/decidim-meetings/app/views/decidim/meetings/meeting_widgets/show.html.erb +18 -0
- data/decidim-meetings/app/views/decidim/meetings/meetings/show.html.erb +1 -0
- data/decidim-meetings/config/locales/ca.yml +5 -5
- data/decidim-meetings/config/locales/en.yml +5 -5
- data/decidim-meetings/config/locales/es.yml +5 -5
- data/decidim-meetings/config/locales/eu.yml +0 -7
- data/decidim-meetings/config/locales/fi.yml +0 -7
- data/decidim-meetings/config/locales/fr.yml +5 -0
- data/decidim-meetings/config/locales/nl.yml +5 -0
- data/decidim-meetings/db/migrate/20170410074252_remove_not_null_reference_meetings.rb +5 -0
- data/decidim-meetings/lib/decidim/meetings/list_engine.rb +3 -1
- data/decidim-meetings/spec/shared/manage_meetings_examples.rb +87 -72
- data/decidim-pages/README.md +2 -2
- data/decidim-pages/config/locales/ca.yml +1 -1
- data/decidim-pages/config/locales/en.yml +1 -1
- data/decidim-pages/config/locales/es.yml +1 -1
- data/decidim-pages/config/locales/eu.yml +0 -1
- data/decidim-pages/config/locales/fi.yml +0 -1
- data/decidim-pages/config/locales/fr.yml +5 -0
- data/decidim-pages/config/locales/nl.yml +5 -0
- data/decidim-proposals/README.md +2 -2
- data/decidim-proposals/app/controllers/decidim/proposals/proposal_widgets_controller.rb +24 -0
- data/decidim-proposals/app/controllers/decidim/proposals/proposals_controller.rb +13 -4
- data/decidim-proposals/app/helpers/decidim/proposals/application_helper.rb +15 -0
- data/decidim-proposals/app/helpers/decidim/proposals/proposal_order_helper.rb +1 -1
- data/decidim-proposals/app/views/decidim/proposals/admin/proposals/index.html.erb +6 -9
- data/decidim-proposals/app/views/decidim/proposals/proposal_widgets/show.html.erb +25 -0
- data/decidim-proposals/app/views/decidim/proposals/proposals/_vote_button.html.erb +9 -3
- data/decidim-proposals/app/views/decidim/proposals/proposals/_votes_count.html.erb +8 -7
- data/decidim-proposals/app/views/decidim/proposals/proposals/show.html.erb +3 -6
- data/decidim-proposals/config/locales/ca.yml +5 -5
- data/decidim-proposals/config/locales/en.yml +6 -5
- data/decidim-proposals/config/locales/es.yml +5 -5
- data/decidim-proposals/config/locales/eu.yml +0 -6
- data/decidim-proposals/config/locales/fi.yml +0 -5
- data/decidim-proposals/config/locales/fr.yml +5 -0
- data/decidim-proposals/config/locales/nl.yml +5 -0
- data/decidim-proposals/db/migrate/20170410073742_remove_not_null_reference_proposals.rb +5 -0
- data/decidim-proposals/lib/decidim/proposals/engine.rb +1 -0
- data/decidim-proposals/lib/decidim/proposals/feature.rb +1 -0
- data/decidim-proposals/spec/features/proposals_spec.rb +1 -6
- data/decidim-proposals/spec/features/vote_proposal_spec.rb +15 -0
- data/decidim-proposals/spec/helpers/proposal_order_helper_spec.rb +13 -3
- data/decidim-proposals/spec/shared/manage_proposals_examples.rb +43 -9
- data/decidim-results/README.md +2 -2
- data/decidim-results/app/controllers/decidim/results/result_widgets_controller.rb +17 -0
- data/decidim-results/app/controllers/decidim/results/results_controller.rb +1 -0
- data/decidim-results/app/views/decidim/results/result_widgets/show.html.erb +10 -0
- data/decidim-results/app/views/decidim/results/results/show.html.erb +1 -0
- data/decidim-results/config/locales/ca.yml +3 -3
- data/decidim-results/config/locales/en.yml +3 -3
- data/decidim-results/config/locales/es.yml +3 -3
- data/decidim-results/config/locales/eu.yml +0 -3
- data/decidim-results/config/locales/fi.yml +0 -3
- data/decidim-results/config/locales/fr.yml +5 -0
- data/decidim-results/config/locales/nl.yml +5 -0
- data/decidim-results/db/migrate/20170410074358_remove_not_null_reference_results.rb +5 -0
- data/decidim-results/lib/decidim/results/list_engine.rb +3 -1
- data/decidim-results/spec/shared/manage_results_examples.rb +1 -1
- data/decidim-system/config/locales/ca.yml +3 -3
- data/decidim-system/config/locales/en.yml +3 -3
- data/decidim-system/config/locales/es.yml +3 -3
- data/decidim-system/config/locales/eu.yml +0 -3
- data/decidim-system/config/locales/fi.yml +0 -3
- data/decidim-system/config/locales/fr.yml +5 -0
- data/decidim-system/config/locales/nl.yml +5 -0
- data/docs/features_and_components.md +1 -1
- data/docs/geocoding.md +34 -0
- data/docs/getting_started.md +135 -0
- data/docs/testing.md +17 -0
- data/lib/generators/decidim/app_generator.rb +7 -0
- data/lib/generators/decidim/templates/Gemfile.erb +4 -4
- data/lib/generators/decidim/templates/README.md.erb +1 -1
- data/lib/generators/decidim/templates/authorization_handler.rb +5 -1
- data/package.json +1 -1
- data/run_ci.sh +6 -6
- metadata +61 -23
data/decidim-api/README.md
CHANGED
@@ -23,7 +23,7 @@ $ bundle
|
|
23
23
|
```
|
24
24
|
|
25
25
|
## Contributing
|
26
|
-
See [Decidim](https://github.com/
|
26
|
+
See [Decidim](https://github.com/decidim/decidim).
|
27
27
|
|
28
28
|
## License
|
29
|
-
See [Decidim](https://github.com/
|
29
|
+
See [Decidim](https://github.com/decidim/decidim).
|
data/decidim-budgets/README.md
CHANGED
@@ -17,7 +17,7 @@ $ bundle
|
|
17
17
|
```
|
18
18
|
|
19
19
|
## Contributing
|
20
|
-
See [Decidim](https://github.com/
|
20
|
+
See [Decidim](https://github.com/decidim/decidim).
|
21
21
|
|
22
22
|
## License
|
23
|
-
See [Decidim](https://github.com/
|
23
|
+
See [Decidim](https://github.com/decidim/decidim).
|
@@ -15,7 +15,7 @@ ca:
|
|
15
15
|
confirm_destroy: Estàs segur que vols eliminar aquest projecte?
|
16
16
|
destroy: Esborrar
|
17
17
|
edit: Editar
|
18
|
-
new: Nou
|
18
|
+
new: Nou
|
19
19
|
preview: Previsualitzar
|
20
20
|
title: Accions
|
21
21
|
admin:
|
@@ -30,13 +30,13 @@ ca:
|
|
30
30
|
success: Projecte eliminat correctament
|
31
31
|
edit:
|
32
32
|
title: Editar projecte
|
33
|
-
update: Actualitzar
|
33
|
+
update: Actualitzar
|
34
34
|
index:
|
35
35
|
finished_orders: Vots finalitzats
|
36
36
|
pending_orders: Vots en procés
|
37
37
|
title: Projectes
|
38
38
|
new:
|
39
|
-
create: Crear
|
39
|
+
create: Crear
|
40
40
|
title: Nou resultat
|
41
41
|
update:
|
42
42
|
invalid: Hi ha hagut un problema actualitzant aquest projecte
|
@@ -16,7 +16,7 @@ en:
|
|
16
16
|
confirm_destroy: Are you sure you want to delete this project?
|
17
17
|
destroy: Delete
|
18
18
|
edit: Edit
|
19
|
-
new: New
|
19
|
+
new: New
|
20
20
|
preview: Preview
|
21
21
|
title: Actions
|
22
22
|
admin:
|
@@ -31,13 +31,13 @@ en:
|
|
31
31
|
success: Project successfully destroyed
|
32
32
|
edit:
|
33
33
|
title: Edit project
|
34
|
-
update: Update
|
34
|
+
update: Update
|
35
35
|
index:
|
36
36
|
finished_orders: Finished orders
|
37
37
|
pending_orders: Pending orders
|
38
38
|
title: Projects
|
39
39
|
new:
|
40
|
-
create: Create
|
40
|
+
create: Create
|
41
41
|
title: New result
|
42
42
|
update:
|
43
43
|
invalid: There's been a problem updating this project
|
@@ -15,7 +15,7 @@ es:
|
|
15
15
|
confirm_destroy: '¿Estás seguro de que deseas eliminar este proyecto?'
|
16
16
|
destroy: Borrar
|
17
17
|
edit: Editar
|
18
|
-
new: Nuevo
|
18
|
+
new: Nuevo
|
19
19
|
preview: Previsualizar
|
20
20
|
title: Acciones
|
21
21
|
admin:
|
@@ -30,13 +30,13 @@ es:
|
|
30
30
|
success: Proyecto eliminado exitosamente
|
31
31
|
edit:
|
32
32
|
title: Editar proyecto
|
33
|
-
update: Actualizar
|
33
|
+
update: Actualizar
|
34
34
|
index:
|
35
35
|
finished_orders: Votos finalizados
|
36
36
|
pending_orders: Votos pendientes
|
37
37
|
title: Proyectos
|
38
38
|
new:
|
39
|
-
create: Crear
|
39
|
+
create: Crear
|
40
40
|
title: Nuevo resultado
|
41
41
|
update:
|
42
42
|
invalid: Ha habido un problema al actualizar este proyecto
|
@@ -15,7 +15,6 @@ eu:
|
|
15
15
|
confirm_destroy: Ziur zaude proiektu hau ezabatu nahi duzula?
|
16
16
|
destroy: Garbitu
|
17
17
|
edit: Editatu
|
18
|
-
new: '%{name} berria'
|
19
18
|
preview: Aurreikusi
|
20
19
|
title: Ekintzak
|
21
20
|
admin:
|
@@ -30,13 +29,11 @@ eu:
|
|
30
29
|
success: Proiektu ongi ezabatu da
|
31
30
|
edit:
|
32
31
|
title: Editatu proiektua
|
33
|
-
update: Eguneratu proiektua
|
34
32
|
index:
|
35
33
|
finished_orders: Emandako botoak
|
36
34
|
pending_orders: Emateke dauden botoak
|
37
35
|
title: Proiektuak
|
38
36
|
new:
|
39
|
-
create: Sortu proiektua
|
40
37
|
title: Emaitza berria
|
41
38
|
update:
|
42
39
|
invalid: Arazo bat izan da proiektu hau eguneratzean
|
@@ -15,7 +15,6 @@ fi:
|
|
15
15
|
confirm_destroy: Haluatko varmasti poistaa tämän projektin?
|
16
16
|
destroy: Poista
|
17
17
|
edit: Muokkaa
|
18
|
-
new: Uusi %{name}
|
19
18
|
title: Toiminnot
|
20
19
|
admin:
|
21
20
|
models:
|
@@ -29,13 +28,11 @@ fi:
|
|
29
28
|
success: Projekti tuhottu onnistuneesti
|
30
29
|
edit:
|
31
30
|
title: Muokkaa projektia
|
32
|
-
update: Päivitä projektia
|
33
31
|
index:
|
34
32
|
finished_orders: Valmiit tilaukset
|
35
33
|
pending_orders: Odottavat tilaukset
|
36
34
|
title: Projektit
|
37
35
|
new:
|
38
|
-
create: Luo projekti
|
39
36
|
title: Uusi tulos
|
40
37
|
update:
|
41
38
|
invalid: Tämän projektin päivityksessä tapahtui virhe
|
@@ -0,0 +1,97 @@
|
|
1
|
+
fr:
|
2
|
+
activemodel:
|
3
|
+
attributes:
|
4
|
+
project:
|
5
|
+
budget: Budget
|
6
|
+
decidim_category_id: Catégorie
|
7
|
+
decidim_scope_id: Champ d'application
|
8
|
+
description: Description
|
9
|
+
proposal_ids: Propositions liées
|
10
|
+
title: Titre
|
11
|
+
decidim:
|
12
|
+
budgets:
|
13
|
+
actions:
|
14
|
+
attachments: Pièces jointes
|
15
|
+
confirm_destroy: Êtes-vous certain de vouloir supprimer ce projet?
|
16
|
+
destroy: Supprimer
|
17
|
+
edit: Modifier
|
18
|
+
preview: Aperçu
|
19
|
+
title: Actions
|
20
|
+
admin:
|
21
|
+
models:
|
22
|
+
project:
|
23
|
+
name: Projet
|
24
|
+
projects:
|
25
|
+
create:
|
26
|
+
invalid: Il y a eu un problème lors de la création de ce projet
|
27
|
+
success: Projet créé avec succès
|
28
|
+
destroy:
|
29
|
+
success: Projet supprimé avec succès
|
30
|
+
edit:
|
31
|
+
title: Éditer un projet
|
32
|
+
index:
|
33
|
+
finished_orders: Commandes terminées
|
34
|
+
pending_orders: Commandes en attente
|
35
|
+
title: Projets
|
36
|
+
new:
|
37
|
+
title: Nouveau résultat
|
38
|
+
update:
|
39
|
+
invalid: Il y a eu un problème de mise à jour de ce projet
|
40
|
+
success: Projet mis à jour avec succès
|
41
|
+
models:
|
42
|
+
project:
|
43
|
+
fields:
|
44
|
+
title: Titre
|
45
|
+
projects:
|
46
|
+
budget_confirm:
|
47
|
+
are_you_sure: Êtes-vous d'accord ? Une fois que vous aurez confirmé votre vote, vous ne pourrez plus le modifier.
|
48
|
+
cancel: Annuler
|
49
|
+
confirm: Confirmer
|
50
|
+
description: Voici les projets que vous avez choisis pour le budget.
|
51
|
+
title: Confirmez votre vote
|
52
|
+
budget_excess:
|
53
|
+
close: Fermer
|
54
|
+
description: Ce projet dépasse le budget maximum et ne peut pas être ajouté. Si vous le souhaitez, vous pouvez supprimer un projet que vous avez déjà sélectionné ou voter selon vos préférences.
|
55
|
+
ok: D'accord
|
56
|
+
title: Budget maximum dépassé
|
57
|
+
budget_summary:
|
58
|
+
are_you_sure: Êtes-vous certain de vouloir annuler votre vote ?
|
59
|
+
assigned: 'Affecté à :'
|
60
|
+
cancel_order: supprimer votre vote et recommencer
|
61
|
+
checked_out:
|
62
|
+
description: Vous avez déjà voté pour le budget. Si vous avez changé d'avis, vous pouvez %{cancel_link}.
|
63
|
+
title: Vote du budget terminé
|
64
|
+
description: A quels projets pensez-vous que nous devrions allouer un budget ? Assignez au moins %{minimum_budget} aux projets que vous soutenez et votez selon vos préférences pour définir le budget.
|
65
|
+
title: Vous décidez du budget
|
66
|
+
count:
|
67
|
+
projects_count:
|
68
|
+
one: 1 projet
|
69
|
+
other: "%{count} projets"
|
70
|
+
filters:
|
71
|
+
category: Catégorie
|
72
|
+
category_prompt: Sélectionner une catégorie
|
73
|
+
scopes: Étendues
|
74
|
+
search: Rechercher
|
75
|
+
filters_small_view:
|
76
|
+
close_modal: Fermer la vue
|
77
|
+
filter: Filtrer
|
78
|
+
filter_by: Filtrer par
|
79
|
+
unfold: Déplier
|
80
|
+
order_progress:
|
81
|
+
vote: Voter
|
82
|
+
order_selected_projects:
|
83
|
+
remove: Supprimer
|
84
|
+
selected_projects:
|
85
|
+
one: projet sélectionné
|
86
|
+
other: projets sélectionnés
|
87
|
+
view: Voir
|
88
|
+
project:
|
89
|
+
add: Ajouter
|
90
|
+
count:
|
91
|
+
one: 1 soutien
|
92
|
+
other: "%{count} soutiens"
|
93
|
+
features:
|
94
|
+
budgets:
|
95
|
+
settings:
|
96
|
+
global:
|
97
|
+
vote_threshold_percent: Pourcentage de seuil de vote
|
data/decidim-comments/README.md
CHANGED
@@ -69,7 +69,7 @@ Since we are using Typescript we can generate interfaces and types from our sche
|
|
69
69
|
This command will create a file called `app/frontend/support/schema.ts` that can be used to strict type checking in our components.
|
70
70
|
|
71
71
|
## Contributing
|
72
|
-
See [Decidim](https://github.com/
|
72
|
+
See [Decidim](https://github.com/decidim/decidim).
|
73
73
|
|
74
74
|
## License
|
75
|
-
See [Decidim](https://github.com/
|
75
|
+
See [Decidim](https://github.com/decidim/decidim).
|
Binary file
|
data/decidim-dev/README.md
CHANGED
@@ -18,7 +18,7 @@ $ bundle
|
|
18
18
|
```
|
19
19
|
|
20
20
|
## Contributing
|
21
|
-
See [Decidim](https://github.com/
|
21
|
+
See [Decidim](https://github.com/decidim/decidim).
|
22
22
|
|
23
23
|
## License
|
24
|
-
See [Decidim](https://github.com/
|
24
|
+
See [Decidim](https://github.com/decidim/decidim).
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "letter_opener_web"
|
4
|
+
require "decidim/dev/railtie"
|
4
5
|
|
5
6
|
module Decidim
|
6
7
|
# Decidim::Dev holds all the convenience logic and libraries to be able to
|
@@ -11,11 +12,13 @@ module Decidim
|
|
11
12
|
#
|
12
13
|
# Returns a String with the path for a particular asset.
|
13
14
|
def self.asset(name)
|
14
|
-
File.
|
15
|
-
File.
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
File.expand_path(
|
16
|
+
File.join(
|
17
|
+
File.dirname(__FILE__),
|
18
|
+
"dev",
|
19
|
+
"assets",
|
20
|
+
name
|
21
|
+
)
|
19
22
|
)
|
20
23
|
end
|
21
24
|
end
|
@@ -1,28 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
require "bundler/gem_tasks"
|
3
3
|
require "rspec/core/rake_task"
|
4
|
-
require_relative "../../generators/decidim/dummy_generator"
|
5
|
-
|
6
|
-
engine_path = Dir.pwd
|
7
|
-
engine_name = engine_path.split("/").last
|
8
|
-
dummy_app_path = File.expand_path(File.join(engine_path, "spec", "#{engine_name}_dummy_app"))
|
9
|
-
|
10
|
-
desc "Generates a dummy app for testing"
|
11
|
-
task :generate_test_app do
|
12
|
-
Decidim::Generators::DummyGenerator.start(
|
13
|
-
[
|
14
|
-
"--engine_path=#{engine_path}",
|
15
|
-
"--migrate=true",
|
16
|
-
"--quiet"
|
17
|
-
]
|
18
|
-
)
|
19
|
-
|
20
|
-
require File.join(dummy_app_path, "config", "application")
|
21
|
-
Rails.application.load_tasks
|
22
|
-
Rake.application["assets:precompile"].invoke
|
23
|
-
|
24
|
-
FileUtils.cd(engine_path)
|
25
|
-
end
|
26
4
|
|
27
5
|
RSpec::Core::RakeTask.new(:spec)
|
28
|
-
task default: [:
|
6
|
+
task default: [:spec]
|
@@ -1,13 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
ENV["RAILS_ENV"] ||= "test"
|
3
3
|
|
4
|
+
root_path = File.join(Dir.pwd, "..")
|
4
5
|
engine_name = ENV["ENGINE_NAME"]
|
5
6
|
engine_spec_dir = File.join(Dir.pwd, "spec")
|
6
|
-
dummy_app_path = File.expand_path(File.join(
|
7
|
+
dummy_app_path = File.expand_path(File.join(root_path, "spec", "decidim_dummy_app"))
|
7
8
|
|
8
|
-
if ENV["
|
9
|
+
if ENV["SIMPLECOV"]
|
9
10
|
require "simplecov"
|
10
|
-
SimpleCov.root(
|
11
|
+
SimpleCov.root(root_path)
|
11
12
|
|
12
13
|
SimpleCov.start do
|
13
14
|
filters.clear
|
@@ -17,7 +18,7 @@ if ENV["CI"]
|
|
17
18
|
add_filter "/vendor/"
|
18
19
|
|
19
20
|
add_filter do |src|
|
20
|
-
!(src.filename =~ /^#{
|
21
|
+
!(src.filename =~ /^#{root_path}/)
|
21
22
|
end
|
22
23
|
end
|
23
24
|
|
@@ -34,7 +35,7 @@ require "#{File.dirname(__FILE__)}/rspec_support/feature.rb"
|
|
34
35
|
begin
|
35
36
|
require "#{dummy_app_path}/config/environment"
|
36
37
|
rescue LoadError
|
37
|
-
puts "Could not load dummy application. Please ensure you have run `bundle exec rake generate_test_app`"
|
38
|
+
puts "Could not load dummy application. Please ensure you have run `bundle exec rake decidim:generate_test_app`"
|
38
39
|
puts "Tried to load it from #{dummy_app_path}"
|
39
40
|
exit(-1)
|
40
41
|
end
|
@@ -18,8 +18,8 @@ module Decidim
|
|
18
18
|
class DummyGenerator < Rails::Generators::Base
|
19
19
|
desc "Generate dummy app for testing purposes"
|
20
20
|
|
21
|
-
class_option :
|
22
|
-
|
21
|
+
class_option :dummy_app_path, type: :string,
|
22
|
+
desc: "The path where the dummy app will be installed"
|
23
23
|
|
24
24
|
def source_paths
|
25
25
|
[
|
@@ -28,12 +28,13 @@ module Decidim
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def cleanup
|
31
|
-
remove_directory_if_exists(
|
31
|
+
remove_directory_if_exists(dummy_app_path)
|
32
32
|
end
|
33
33
|
|
34
34
|
def create_dummy_app
|
35
35
|
Decidim::Generators::AppGenerator.start [
|
36
|
-
|
36
|
+
dummy_app_path,
|
37
|
+
"--app_const_base=DummyApplication",
|
37
38
|
"--skip_gemfile",
|
38
39
|
"--skip-bundle",
|
39
40
|
"--skip-git",
|
@@ -44,29 +45,29 @@ module Decidim
|
|
44
45
|
end
|
45
46
|
|
46
47
|
def set_locales
|
47
|
-
inject_into_file "#{
|
48
|
+
inject_into_file "#{dummy_app_path}/config/application.rb", after: "class Application < Rails::Application" do
|
48
49
|
"\n config.i18n.available_locales = %w(en ca es)\n config.i18n.default_locale = :en"
|
49
50
|
end
|
50
51
|
end
|
51
52
|
|
52
53
|
def decidim_dev
|
53
|
-
template "decidim_dev.rb", "#{
|
54
|
+
template "decidim_dev.rb", "#{dummy_app_path}/config/initializers/decidim_dev.rb"
|
54
55
|
|
55
56
|
# TODO: Remove these after PhantomJS updates WebKit version (see YML and
|
56
57
|
# initializer comments)
|
57
|
-
template "autoprefixer.yml", "#{
|
58
|
-
template "autoprefixer_initializer.rb", "#{
|
58
|
+
template "autoprefixer.yml", "#{dummy_app_path}/config/autoprefixer.yml"
|
59
|
+
template "autoprefixer_initializer.rb", "#{dummy_app_path}/config/initializers/autoprefixer.rb"
|
59
60
|
end
|
60
61
|
|
61
62
|
def test_env
|
62
|
-
gsub_file "#{
|
63
|
+
gsub_file "#{dummy_app_path}/config/environments/test.rb",
|
63
64
|
/allow_forgery_protection = (.*)/, 'allow_forgery_protection = true'
|
64
65
|
end
|
65
66
|
|
66
67
|
private
|
67
68
|
|
68
|
-
def
|
69
|
-
|
69
|
+
def dummy_app_path
|
70
|
+
options[:dummy_app_path]
|
70
71
|
end
|
71
72
|
|
72
73
|
def remove_directory_if_exists(path)
|
@@ -74,11 +75,7 @@ module Decidim
|
|
74
75
|
end
|
75
76
|
|
76
77
|
def dir_name
|
77
|
-
|
78
|
-
end
|
79
|
-
|
80
|
-
def engine_path
|
81
|
-
options[:engine_path]
|
78
|
+
dummy_app_path.split("/").last
|
82
79
|
end
|
83
80
|
end
|
84
81
|
end
|