- <% @cards.find_each do |card| %>
+ <% @cards.each do |card| %>
<%= render "card", card: card %>
<% end %>
diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb
index e2ae116e1..6e7b0ef28 100644
--- a/app/views/welcome/index.html.erb
+++ b/app/views/welcome/index.html.erb
@@ -20,9 +20,11 @@
-
- <%= render "cards" %>
-
+ <% if @cards.any? %>
+
+ <%= render "cards" %>
+
+ <% end %>
<%= render "processes" %>
diff --git a/config/i18n-tasks.yml b/config/i18n-tasks.yml
index cef2c8f97..4b683e7fd 100644
--- a/config/i18n-tasks.yml
+++ b/config/i18n-tasks.yml
@@ -128,7 +128,7 @@ ignore_unused:
- 'admin.comments.index.filter*'
- 'admin.banners.index.filters.*'
- 'admin.debates.index.filter*'
- - 'admin.proposals.index.filter*'
+ - 'admin.hidden_proposals.index.filter*'
- 'admin.proposal_notifications.index.filter*'
- 'admin.budgets.index.filter*'
- 'admin.budget_investments.index.filter*'
diff --git a/config/initializers/routes_hierarchy.rb b/config/initializers/routes_hierarchy.rb
index f06acf5c9..0a712f923 100644
--- a/config/initializers/routes_hierarchy.rb
+++ b/config/initializers/routes_hierarchy.rb
@@ -7,8 +7,8 @@ module ActionDispatch::Routing::UrlFor
case resource.class.name
when "Budget::Investment"
[resource.budget, resource]
- when "Budget::Investment::Milestone"
- [resource.investment.budget, resource.investment, resource]
+ when "Milestone"
+ [*resource_hierarchy_for(resource.milestoneable), resource]
when "Legislation::Annotation"
[resource.draft_version.process, resource.draft_version, resource]
when "Legislation::Proposal", "Legislation::Question", "Legislation::DraftVersion"
diff --git a/config/locales/ar/activerecord.yml b/config/locales/ar/activerecord.yml
index 1c4d69c01..5f1ba2c00 100644
--- a/config/locales/ar/activerecord.yml
+++ b/config/locales/ar/activerecord.yml
@@ -86,12 +86,12 @@ ar:
organization_name: "إذا كنت تقترح بإسم جماعي/منظمة, أو نيابة عن أشخاص آخرين, اكتب إسمها"
image: "اقتراح صورة وصفية"
image_title: "عنوان الصورة"
- budget/investment/milestone:
+ milestone:
status_id: "حالة الإستثمار الحالية (إختياري)"
title: "العنوان"
description: "الوصف (إختياري ان كان هناك حالة معينة)"
publication_date: "تاريخ النشر"
- budget/investment/status:
+ milestone/status:
name: "الاسم"
description: "الوصف (إختياري)"
budget/heading:
diff --git a/config/locales/ast/activerecord.yml b/config/locales/ast/activerecord.yml
index 46ea2c973..07e57bfd2 100644
--- a/config/locales/ast/activerecord.yml
+++ b/config/locales/ast/activerecord.yml
@@ -7,7 +7,7 @@ ast:
budget/investment:
one: "Proyectu de inversión"
other: "Proyectos d'inversión"
- budget/investment/milestone:
+ milestone:
one: "finxu"
other: "finxos"
comment:
diff --git a/config/locales/ca/activerecord.yml b/config/locales/ca/activerecord.yml
index 99c24dddd..121f343fa 100644
--- a/config/locales/ca/activerecord.yml
+++ b/config/locales/ca/activerecord.yml
@@ -10,7 +10,7 @@ ca:
budget/investment:
one: "Proposta d'inversió"
other: "Propostes d'inversió"
- budget/investment/milestone:
+ milestone:
one: "fita"
other: "fites"
comment:
diff --git a/config/locales/de-DE/activerecord.yml b/config/locales/de-DE/activerecord.yml
index 0b61727e9..8032a3aff 100644
--- a/config/locales/de-DE/activerecord.yml
+++ b/config/locales/de-DE/activerecord.yml
@@ -10,10 +10,10 @@ de:
budget/investment:
one: "Ausgabenvorschlag"
other: "Ausgabenvorschläge"
- budget/investment/milestone:
+ milestone:
one: "Meilenstein"
other: "Meilensteine"
- budget/investment/status:
+ milestone/status:
one: "Status des Ausgabenvorschlags"
other: "Status der Ausgabenvorschläge"
comment:
@@ -131,12 +131,12 @@ de:
organization_name: "Wenn Sie einen Vorschlag im Namen einer Gruppe, Organisation oder mehreren Personen einreichen, nennen Sie bitte dessen/deren Name/n"
image: "Beschreibendes Bild zum Ausgabenvorschlag"
image_title: "Bildtitel"
- budget/investment/milestone:
+ milestone:
status_id: "Derzeitiger Status des Ausgabenvorschlags (optional)"
title: "Titel"
description: "Beschreibung (optional, wenn kein Status zugewiesen ist)"
publication_date: "Datum der Veröffentlichung"
- budget/investment/status:
+ milestone/status:
name: "Name"
description: "Beschreibung (optional)"
budget/heading:
diff --git a/config/locales/de-DE/admin.yml b/config/locales/de-DE/admin.yml
index 97d982f81..715b905b4 100644
--- a/config/locales/de-DE/admin.yml
+++ b/config/locales/de-DE/admin.yml
@@ -403,7 +403,7 @@ de:
status_planned: Geplant
subnav:
info: Information
- draft_texts: Ausarbeitung
+ draft_versions: Ausarbeitung
questions: Diskussion
proposals: Vorschläge
proposals:
@@ -1004,7 +1004,7 @@ de:
search:
title: Organisationen suchen
no_results: Keine Organisationen gefunden.
- proposals:
+ hidden_proposals:
index:
filter: Filter
filters:
diff --git a/config/locales/en-US/activerecord.yml b/config/locales/en-US/activerecord.yml
index 28deaa039..0bf16fa71 100644
--- a/config/locales/en-US/activerecord.yml
+++ b/config/locales/en-US/activerecord.yml
@@ -1,10 +1,10 @@
en-US:
activerecord:
models:
- budget/investment/milestone:
+ milestone:
one: "Meilenstein"
other: "Meilensteine"
- budget/investment/status:
+ milestone/status:
one: "Investitionsstatus, Anlagenstatus"
other: "Investitionsstatus, Anlagenstatus"
comment:
diff --git a/config/locales/en/activerecord.yml b/config/locales/en/activerecord.yml
index 0ed4a9872..6f21668c1 100644
--- a/config/locales/en/activerecord.yml
+++ b/config/locales/en/activerecord.yml
@@ -10,12 +10,12 @@ en:
budget/investment:
one: "Investment"
other: "Investments"
- budget/investment/milestone:
+ milestone:
one: "milestone"
other: "milestones"
- budget/investment/status:
- one: "Investment status"
- other: "Investment statuses"
+ milestone/status:
+ one: "Milestone Status"
+ other: "Milestone Statuses"
comment:
one: "Comment"
other: "Comments"
@@ -82,9 +82,6 @@ en:
legislation/draft_versions:
one: "Draft version"
other: "Draft versions"
- legislation/draft_texts:
- one: "Draft"
- other: "Drafts"
legislation/questions:
one: "Question"
other: "Questions"
@@ -131,12 +128,12 @@ en:
organization_name: "If you are proposing in the name of a collective/organization, or on behalf of more people, write its name"
image: "Proposal descriptive image"
image_title: "Image title"
- budget/investment/milestone:
+ milestone:
status_id: "Current investment status (optional)"
title: "Title"
description: "Description (optional if there's an status assigned)"
publication_date: "Publication date"
- budget/investment/status:
+ milestone/status:
name: "Name"
description: "Description (optional)"
budget/heading:
diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml
index df3e6c0b9..6b85afdf0 100644
--- a/config/locales/en/admin.yml
+++ b/config/locales/en/admin.yml
@@ -135,6 +135,8 @@ en:
max_votable_headings: "Maximum number of headings in which a user can vote"
current_of_max_headings: "%{current} of %{max}"
allow_content_block: Allow content block
+ latitude: Latitude
+ longitude: Longitude
winners:
calculate: Calculate Winner Investments
calculated: Winners being calculated, it may take a minute.
@@ -290,24 +292,24 @@ en:
notice: Milestone successfully deleted
statuses:
index:
- title: Investment statuses
- empty_statuses: There are no investment statuses created
- new_status: Create new investment status
+ title: Milestone statuses
+ empty_statuses: There are no milestone statuses created
+ new_status: Create new milestone status
table_name: Name
table_description: Description
table_actions: Actions
delete: Delete
edit: Edit
edit:
- title: Edit investment status
+ title: Edit milestone status
update:
- notice: Investment status updated successfully
+ notice: Milestone status updated successfully
new:
- title: Create investment status
+ title: Create milestone status
create:
- notice: Investment status created successfully
+ notice: Milestone status created successfully
delete:
- notice: Investment status deleted successfully
+ notice: Milestone status deleted successfully
comments:
index:
filter: Filter
@@ -417,7 +419,7 @@ en:
status_planned: Planned
subnav:
info: Information
- draft_texts: Drafting
+ draft_versions: Drafting
questions: Debate
proposals: Proposals
proposals:
@@ -1038,7 +1040,7 @@ en:
search:
title: Search Organisations
no_results: No organizations found.
- proposals:
+ hidden_proposals:
index:
filter: Filter
filters:
diff --git a/config/locales/en/settings.yml b/config/locales/en/settings.yml
index d8f6717b3..f8b9bf0d7 100644
--- a/config/locales/en/settings.yml
+++ b/config/locales/en/settings.yml
@@ -20,6 +20,8 @@ en:
max_votes_for_debate_edit_description: "From this number of votes the author of a Debate can no longer edit it"
proposal_code_prefix: "Prefix for Proposal codes"
proposal_code_prefix_description: "This prefix will appear in the Proposals before the creation date and its ID"
+ featured_proposals_number: "Number of featured proposals"
+ featured_proposals_number_description: "Number of featured proposals that will be displayed if the Featured proposals feature is active"
votes_for_proposal_success: "Number of votes necessary for approval of a Proposal"
votes_for_proposal_success_description: "When a proposal reaches this number of supports it will no longer be able to receive more supports and is considered successful"
months_to_archive_proposals: "Months to archive Proposals"
@@ -85,6 +87,8 @@ en:
google_login_description: "Allow users to sign up with their Google Account"
proposals: "Proposals"
proposals_description: "Citizens' proposals are an opportunity for neighbours and collectives to decide directly how they want their city to be, after getting sufficient support and submitting to a citizens' vote"
+ featured_proposals: "Featured proposals"
+ featured_proposals_description: "Shows featured proposals on index proposals page"
debates: "Debates"
debates_description: "The citizens' debate space is aimed at anyone who can present issues that concern them and about which they want to share their views with others"
polls: "Polls"
diff --git a/config/locales/es-AR/activerecord.yml b/config/locales/es-AR/activerecord.yml
index 23b50fca7..9e838c744 100644
--- a/config/locales/es-AR/activerecord.yml
+++ b/config/locales/es-AR/activerecord.yml
@@ -7,10 +7,10 @@ es-AR:
budget/investment:
one: "Proyecto de inversión"
other: "Proyectos de inversión"
- budget/investment/milestone:
+ milestone:
one: "hito"
other: "hitos"
- budget/investment/status:
+ milestone/status:
one: "Estado de Inversiones"
other: "Estado de Inversiones"
comment:
@@ -113,12 +113,12 @@ es-AR:
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
image: "Imagen descriptiva de la propuesta de inversión"
image_title: "Título de la imagen"
- budget/investment/milestone:
+ milestone:
status_id: "Estado de inversión actual ( opcional)"
title: "Título"
description: "Descripción (opcional si hay estado asignado)"
publication_date: "Fecha de publicación"
- budget/investment/status:
+ milestone/status:
name: "Nombre"
description: "Descripción (opcional)"
budget/heading:
diff --git a/config/locales/es-AR/admin.yml b/config/locales/es-AR/admin.yml
index 2b3def5f7..f6e23985a 100644
--- a/config/locales/es-AR/admin.yml
+++ b/config/locales/es-AR/admin.yml
@@ -367,7 +367,7 @@ es-AR:
status_planned: Próximamente
subnav:
info: Información
- draft_texts: Redacción
+ draft_versions: Redacción
questions: Debate
proposals: Propuestas
proposals:
@@ -906,7 +906,7 @@ es-AR:
search:
title: Buscar Organizaciones
no_results: No se han encontrado organizaciones.
- proposals:
+ hidden_proposals:
index:
filter: Filtro
filters:
diff --git a/config/locales/es-BO/activerecord.yml b/config/locales/es-BO/activerecord.yml
index 9eff5337e..878fd2c7d 100644
--- a/config/locales/es-BO/activerecord.yml
+++ b/config/locales/es-BO/activerecord.yml
@@ -7,7 +7,7 @@ es-BO:
budget/investment:
one: "Proyecto de inversión"
other: "Proyectos de inversión"
- budget/investment/milestone:
+ milestone:
one: "hito"
other: "hitos"
comment:
@@ -104,7 +104,7 @@ es-BO:
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
image: "Imagen descriptiva de la propuesta de inversión"
image_title: "Título de la imagen"
- budget/investment/milestone:
+ milestone:
title: "Título"
publication_date: "Fecha de publicación"
budget/heading:
diff --git a/config/locales/es-BO/admin.yml b/config/locales/es-BO/admin.yml
index 806516882..afb2fefdd 100644
--- a/config/locales/es-BO/admin.yml
+++ b/config/locales/es-BO/admin.yml
@@ -711,7 +711,7 @@ es-BO:
search:
title: Buscar Organizaciones
no_results: No se han encontrado organizaciones.
- proposals:
+ hidden_proposals:
index:
filter: Filtro
filters:
diff --git a/config/locales/es-CL/activerecord.yml b/config/locales/es-CL/activerecord.yml
index 826b5101f..0bd35df38 100644
--- a/config/locales/es-CL/activerecord.yml
+++ b/config/locales/es-CL/activerecord.yml
@@ -10,10 +10,10 @@ es-CL:
budget/investment:
one: "Proyecto de inversión"
other: "Proyectos de inversión"
- budget/investment/milestone:
+ milestone:
one: "hito"
other: "hitos"
- budget/investment/status:
+ milestone/status:
one: "Estado de la inversión"
other: "Estados de las inversiones"
comment:
@@ -128,12 +128,12 @@ es-CL:
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
image: "Imagen descriptiva de la propuesta de inversión"
image_title: "Título de la imagen"
- budget/investment/milestone:
+ milestone:
status_id: "Estado actual de la inversión (opcional)"
title: "Título"
description: "Descripción (opcional si hay una condición asignada)"
publication_date: "Fecha de publicación"
- budget/investment/status:
+ milestone/status:
name: "Nombre"
description: "Descripción (opcional)"
budget/heading:
diff --git a/config/locales/es-CL/admin.yml b/config/locales/es-CL/admin.yml
index f47074f48..4a69fe2ea 100644
--- a/config/locales/es-CL/admin.yml
+++ b/config/locales/es-CL/admin.yml
@@ -361,7 +361,7 @@ es-CL:
status_planned: Próximamente
subnav:
info: Información
- draft_texts: Redacción
+ draft_versions: Redacción
questions: Debate
proposals: Propuestas
proposals:
@@ -841,7 +841,7 @@ es-CL:
search:
title: Buscar Organizaciones
no_results: No se han encontrado organizaciones.
- proposals:
+ hidden_proposals:
index:
filter: Filtro
filters:
diff --git a/config/locales/es-CO/activerecord.yml b/config/locales/es-CO/activerecord.yml
index 41ebf026a..69cadde05 100644
--- a/config/locales/es-CO/activerecord.yml
+++ b/config/locales/es-CO/activerecord.yml
@@ -7,7 +7,7 @@ es-CO:
budget/investment:
one: "Proyecto de inversión"
other: "Proyectos de inversión"
- budget/investment/milestone:
+ milestone:
one: "hito"
other: "hitos"
comment:
@@ -104,7 +104,7 @@ es-CO:
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
image: "Imagen descriptiva de la propuesta de inversión"
image_title: "Título de la imagen"
- budget/investment/milestone:
+ milestone:
title: "Título"
publication_date: "Fecha de publicación"
budget/heading:
diff --git a/config/locales/es-CO/admin.yml b/config/locales/es-CO/admin.yml
index 793ec0af2..8f34dfe18 100644
--- a/config/locales/es-CO/admin.yml
+++ b/config/locales/es-CO/admin.yml
@@ -711,7 +711,7 @@ es-CO:
search:
title: Buscar Organizaciones
no_results: No se han encontrado organizaciones.
- proposals:
+ hidden_proposals:
index:
filter: Filtro
filters:
diff --git a/config/locales/es-CR/activerecord.yml b/config/locales/es-CR/activerecord.yml
index bc2bcff15..d24c27af4 100644
--- a/config/locales/es-CR/activerecord.yml
+++ b/config/locales/es-CR/activerecord.yml
@@ -7,7 +7,7 @@ es-CR:
budget/investment:
one: "Proyecto de inversión"
other: "Proyectos de inversión"
- budget/investment/milestone:
+ milestone:
one: "hito"
other: "hitos"
comment:
@@ -104,7 +104,7 @@ es-CR:
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
image: "Imagen descriptiva de la propuesta de inversión"
image_title: "Título de la imagen"
- budget/investment/milestone:
+ milestone:
title: "Título"
publication_date: "Fecha de publicación"
budget/heading:
diff --git a/config/locales/es-CR/admin.yml b/config/locales/es-CR/admin.yml
index 353036c46..965b7c0ad 100644
--- a/config/locales/es-CR/admin.yml
+++ b/config/locales/es-CR/admin.yml
@@ -711,7 +711,7 @@ es-CR:
search:
title: Buscar Organizaciones
no_results: No se han encontrado organizaciones.
- proposals:
+ hidden_proposals:
index:
filter: Filtro
filters:
diff --git a/config/locales/es-DO/activerecord.yml b/config/locales/es-DO/activerecord.yml
index e0cfcc982..21b0d65fa 100644
--- a/config/locales/es-DO/activerecord.yml
+++ b/config/locales/es-DO/activerecord.yml
@@ -7,7 +7,7 @@ es-DO:
budget/investment:
one: "Proyecto de inversión"
other: "Proyectos de inversión"
- budget/investment/milestone:
+ milestone:
one: "hito"
other: "hitos"
comment:
@@ -104,7 +104,7 @@ es-DO:
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
image: "Imagen descriptiva de la propuesta de inversión"
image_title: "Título de la imagen"
- budget/investment/milestone:
+ milestone:
title: "Título"
publication_date: "Fecha de publicación"
budget/heading:
diff --git a/config/locales/es-DO/admin.yml b/config/locales/es-DO/admin.yml
index 03c35998d..15248078f 100644
--- a/config/locales/es-DO/admin.yml
+++ b/config/locales/es-DO/admin.yml
@@ -711,7 +711,7 @@ es-DO:
search:
title: Buscar Organizaciones
no_results: No se han encontrado organizaciones.
- proposals:
+ hidden_proposals:
index:
filter: Filtro
filters:
diff --git a/config/locales/es-EC/activerecord.yml b/config/locales/es-EC/activerecord.yml
index d097a6eec..4540f0839 100644
--- a/config/locales/es-EC/activerecord.yml
+++ b/config/locales/es-EC/activerecord.yml
@@ -7,7 +7,7 @@ es-EC:
budget/investment:
one: "Proyecto de inversión"
other: "Proyectos de inversión"
- budget/investment/milestone:
+ milestone:
one: "hito"
other: "hitos"
comment:
@@ -104,7 +104,7 @@ es-EC:
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
image: "Imagen descriptiva de la propuesta de inversión"
image_title: "Título de la imagen"
- budget/investment/milestone:
+ milestone:
title: "Título"
publication_date: "Fecha de publicación"
budget/heading:
diff --git a/config/locales/es-EC/admin.yml b/config/locales/es-EC/admin.yml
index 334585fe8..86e3e5759 100644
--- a/config/locales/es-EC/admin.yml
+++ b/config/locales/es-EC/admin.yml
@@ -711,7 +711,7 @@ es-EC:
search:
title: Buscar Organizaciones
no_results: No se han encontrado organizaciones.
- proposals:
+ hidden_proposals:
index:
filter: Filtro
filters:
diff --git a/config/locales/es-GT/activerecord.yml b/config/locales/es-GT/activerecord.yml
index 5147d66da..1e9b19bf0 100644
--- a/config/locales/es-GT/activerecord.yml
+++ b/config/locales/es-GT/activerecord.yml
@@ -7,7 +7,7 @@ es-GT:
budget/investment:
one: "Proyecto de inversión"
other: "Proyectos de inversión"
- budget/investment/milestone:
+ milestone:
one: "hito"
other: "hitos"
comment:
@@ -104,7 +104,7 @@ es-GT:
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
image: "Imagen descriptiva de la propuesta de inversión"
image_title: "Título de la imagen"
- budget/investment/milestone:
+ milestone:
title: "Título"
publication_date: "Fecha de publicación"
budget/heading:
diff --git a/config/locales/es-GT/admin.yml b/config/locales/es-GT/admin.yml
index d974c4884..2e17a78cc 100644
--- a/config/locales/es-GT/admin.yml
+++ b/config/locales/es-GT/admin.yml
@@ -711,7 +711,7 @@ es-GT:
search:
title: Buscar Organizaciones
no_results: No se han encontrado organizaciones.
- proposals:
+ hidden_proposals:
index:
filter: Filtro
filters:
diff --git a/config/locales/es-HN/activerecord.yml b/config/locales/es-HN/activerecord.yml
index 483778186..7d597d531 100644
--- a/config/locales/es-HN/activerecord.yml
+++ b/config/locales/es-HN/activerecord.yml
@@ -7,7 +7,7 @@ es-HN:
budget/investment:
one: "Proyecto de inversión"
other: "Proyectos de inversión"
- budget/investment/milestone:
+ milestone:
one: "hito"
other: "hitos"
comment:
@@ -104,7 +104,7 @@ es-HN:
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
image: "Imagen descriptiva de la propuesta de inversión"
image_title: "Título de la imagen"
- budget/investment/milestone:
+ milestone:
title: "Título"
publication_date: "Fecha de publicación"
budget/heading:
diff --git a/config/locales/es-HN/admin.yml b/config/locales/es-HN/admin.yml
index 33951812a..e1c75fc71 100644
--- a/config/locales/es-HN/admin.yml
+++ b/config/locales/es-HN/admin.yml
@@ -711,7 +711,7 @@ es-HN:
search:
title: Buscar Organizaciones
no_results: No se han encontrado organizaciones.
- proposals:
+ hidden_proposals:
index:
filter: Filtro
filters:
diff --git a/config/locales/es-MX/activerecord.yml b/config/locales/es-MX/activerecord.yml
index 7d0d80da0..2e64e6124 100644
--- a/config/locales/es-MX/activerecord.yml
+++ b/config/locales/es-MX/activerecord.yml
@@ -10,10 +10,10 @@ es-MX:
budget/investment:
one: "Proyecto de inversión"
other: "Proyectos de inversión"
- budget/investment/milestone:
+ milestone:
one: "hito"
other: "hitos"
- budget/investment/status:
+ milestone/status:
one: "Estado de inversión"
other: "Estados de inversión"
comment:
@@ -128,11 +128,11 @@ es-MX:
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
image: "Imagen descriptiva de la propuesta de inversión"
image_title: "Título de la imagen"
- budget/investment/milestone:
+ milestone:
title: "Título"
description: "Descripción (opcional si cuenta con un estado asignado)"
publication_date: "Fecha de publicación"
- budget/investment/status:
+ milestone/status:
name: "Nombre"
description: "Descripción (opcional)"
budget/heading:
diff --git a/config/locales/es-MX/admin.yml b/config/locales/es-MX/admin.yml
index 8196084af..e1828cbf9 100644
--- a/config/locales/es-MX/admin.yml
+++ b/config/locales/es-MX/admin.yml
@@ -711,7 +711,7 @@ es-MX:
search:
title: Buscar Organizaciones
no_results: No se han encontrado organizaciones.
- proposals:
+ hidden_proposals:
index:
filter: Filtro
filters:
diff --git a/config/locales/es-NI/activerecord.yml b/config/locales/es-NI/activerecord.yml
index d3b6d8242..c9aad963a 100644
--- a/config/locales/es-NI/activerecord.yml
+++ b/config/locales/es-NI/activerecord.yml
@@ -7,7 +7,7 @@ es-NI:
budget/investment:
one: "Proyecto de inversión"
other: "Proyectos de inversión"
- budget/investment/milestone:
+ milestone:
one: "hito"
other: "hitos"
comment:
@@ -104,7 +104,7 @@ es-NI:
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
image: "Imagen descriptiva de la propuesta de inversión"
image_title: "Título de la imagen"
- budget/investment/milestone:
+ milestone:
title: "Título"
publication_date: "Fecha de publicación"
budget/heading:
diff --git a/config/locales/es-NI/admin.yml b/config/locales/es-NI/admin.yml
index 45235417d..3f810fdf9 100644
--- a/config/locales/es-NI/admin.yml
+++ b/config/locales/es-NI/admin.yml
@@ -711,7 +711,7 @@ es-NI:
search:
title: Buscar Organizaciones
no_results: No se han encontrado organizaciones.
- proposals:
+ hidden_proposals:
index:
filter: Filtro
filters:
diff --git a/config/locales/es-PA/activerecord.yml b/config/locales/es-PA/activerecord.yml
index 95f617cbd..eac061779 100644
--- a/config/locales/es-PA/activerecord.yml
+++ b/config/locales/es-PA/activerecord.yml
@@ -7,7 +7,7 @@ es-PA:
budget/investment:
one: "Proyecto de inversión"
other: "Proyectos de inversión"
- budget/investment/milestone:
+ milestone:
one: "hito"
other: "hitos"
comment:
@@ -104,7 +104,7 @@ es-PA:
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
image: "Imagen descriptiva de la propuesta de inversión"
image_title: "Título de la imagen"
- budget/investment/milestone:
+ milestone:
title: "Título"
publication_date: "Fecha de publicación"
budget/heading:
diff --git a/config/locales/es-PA/admin.yml b/config/locales/es-PA/admin.yml
index e9483eb97..cce514212 100644
--- a/config/locales/es-PA/admin.yml
+++ b/config/locales/es-PA/admin.yml
@@ -711,7 +711,7 @@ es-PA:
search:
title: Buscar Organizaciones
no_results: No se han encontrado organizaciones.
- proposals:
+ hidden_proposals:
index:
filter: Filtro
filters:
diff --git a/config/locales/es-PE/activerecord.yml b/config/locales/es-PE/activerecord.yml
index 4604a2868..8569e3bfc 100644
--- a/config/locales/es-PE/activerecord.yml
+++ b/config/locales/es-PE/activerecord.yml
@@ -7,7 +7,7 @@ es-PE:
budget/investment:
one: "Proyecto de inversión"
other: "Proyectos de inversión"
- budget/investment/milestone:
+ milestone:
one: "hito"
other: "hitos"
comment:
@@ -104,7 +104,7 @@ es-PE:
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
image: "Imagen descriptiva de la propuesta de inversión"
image_title: "Título de la imagen"
- budget/investment/milestone:
+ milestone:
title: "Título"
publication_date: "Fecha de publicación"
budget/heading:
diff --git a/config/locales/es-PE/admin.yml b/config/locales/es-PE/admin.yml
index d528b657e..dec901512 100644
--- a/config/locales/es-PE/admin.yml
+++ b/config/locales/es-PE/admin.yml
@@ -711,7 +711,7 @@ es-PE:
search:
title: Buscar Organizaciones
no_results: No se han encontrado organizaciones.
- proposals:
+ hidden_proposals:
index:
filter: Filtro
filters:
diff --git a/config/locales/es-PR/activerecord.yml b/config/locales/es-PR/activerecord.yml
index cf38eaba8..08d1a8662 100644
--- a/config/locales/es-PR/activerecord.yml
+++ b/config/locales/es-PR/activerecord.yml
@@ -7,7 +7,7 @@ es-PR:
budget/investment:
one: "Proyecto de inversión"
other: "Proyectos de inversión"
- budget/investment/milestone:
+ milestone:
one: "hito"
other: "hitos"
comment:
@@ -104,7 +104,7 @@ es-PR:
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
image: "Imagen descriptiva de la propuesta de inversión"
image_title: "Título de la imagen"
- budget/investment/milestone:
+ milestone:
title: "Título"
publication_date: "Fecha de publicación"
budget/heading:
diff --git a/config/locales/es-PR/admin.yml b/config/locales/es-PR/admin.yml
index 64eaa5fb7..3ab25fd5c 100644
--- a/config/locales/es-PR/admin.yml
+++ b/config/locales/es-PR/admin.yml
@@ -711,7 +711,7 @@ es-PR:
search:
title: Buscar Organizaciones
no_results: No se han encontrado organizaciones.
- proposals:
+ hidden_proposals:
index:
filter: Filtro
filters:
diff --git a/config/locales/es-PY/activerecord.yml b/config/locales/es-PY/activerecord.yml
index fc3dd64b4..27150dfca 100644
--- a/config/locales/es-PY/activerecord.yml
+++ b/config/locales/es-PY/activerecord.yml
@@ -7,7 +7,7 @@ es-PY:
budget/investment:
one: "Proyecto de inversión"
other: "Proyectos de inversión"
- budget/investment/milestone:
+ milestone:
one: "hito"
other: "hitos"
comment:
@@ -104,7 +104,7 @@ es-PY:
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
image: "Imagen descriptiva de la propuesta de inversión"
image_title: "Título de la imagen"
- budget/investment/milestone:
+ milestone:
title: "Título"
publication_date: "Fecha de publicación"
budget/heading:
diff --git a/config/locales/es-PY/admin.yml b/config/locales/es-PY/admin.yml
index 67f8d089d..d8b85a909 100644
--- a/config/locales/es-PY/admin.yml
+++ b/config/locales/es-PY/admin.yml
@@ -711,7 +711,7 @@ es-PY:
search:
title: Buscar Organizaciones
no_results: No se han encontrado organizaciones.
- proposals:
+ hidden_proposals:
index:
filter: Filtro
filters:
diff --git a/config/locales/es-SV/activerecord.yml b/config/locales/es-SV/activerecord.yml
index a4c3430c6..594d2003b 100644
--- a/config/locales/es-SV/activerecord.yml
+++ b/config/locales/es-SV/activerecord.yml
@@ -7,7 +7,7 @@ es-SV:
budget/investment:
one: "Proyecto de inversión"
other: "Proyectos de inversión"
- budget/investment/milestone:
+ milestone:
one: "hito"
other: "hitos"
comment:
@@ -104,7 +104,7 @@ es-SV:
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
image: "Imagen descriptiva de la propuesta de inversión"
image_title: "Título de la imagen"
- budget/investment/milestone:
+ milestone:
title: "Título"
publication_date: "Fecha de publicación"
budget/heading:
diff --git a/config/locales/es-SV/admin.yml b/config/locales/es-SV/admin.yml
index dd6b5347b..40c1dae93 100644
--- a/config/locales/es-SV/admin.yml
+++ b/config/locales/es-SV/admin.yml
@@ -711,7 +711,7 @@ es-SV:
search:
title: Buscar Organizaciones
no_results: No se han encontrado organizaciones.
- proposals:
+ hidden_proposals:
index:
filter: Filtro
filters:
diff --git a/config/locales/es-UY/activerecord.yml b/config/locales/es-UY/activerecord.yml
index e8348ed68..ffa5059fd 100644
--- a/config/locales/es-UY/activerecord.yml
+++ b/config/locales/es-UY/activerecord.yml
@@ -7,7 +7,7 @@ es-UY:
budget/investment:
one: "Proyecto de inversión"
other: "Proyectos de inversión"
- budget/investment/milestone:
+ milestone:
one: "hito"
other: "hitos"
comment:
@@ -104,7 +104,7 @@ es-UY:
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
image: "Imagen descriptiva de la propuesta de inversión"
image_title: "Título de la imagen"
- budget/investment/milestone:
+ milestone:
title: "Título"
publication_date: "Fecha de publicación"
budget/heading:
diff --git a/config/locales/es-UY/admin.yml b/config/locales/es-UY/admin.yml
index 06887edc7..a8857cab4 100644
--- a/config/locales/es-UY/admin.yml
+++ b/config/locales/es-UY/admin.yml
@@ -711,7 +711,7 @@ es-UY:
search:
title: Buscar Organizaciones
no_results: No se han encontrado organizaciones.
- proposals:
+ hidden_proposals:
index:
filter: Filtro
filters:
diff --git a/config/locales/es-VE/activerecord.yml b/config/locales/es-VE/activerecord.yml
index 13e76a7be..7878f5019 100644
--- a/config/locales/es-VE/activerecord.yml
+++ b/config/locales/es-VE/activerecord.yml
@@ -7,7 +7,7 @@ es-VE:
budget/investment:
one: "Proyecto de inversión"
other: "Proyectos de inversión"
- budget/investment/milestone:
+ milestone:
one: "hito"
other: "hitos"
comment:
@@ -104,7 +104,7 @@ es-VE:
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
image: "Imagen descriptiva de la propuesta de inversión"
image_title: "Título de la imagen"
- budget/investment/milestone:
+ milestone:
title: "Título"
publication_date: "Fecha de publicación"
budget/heading:
diff --git a/config/locales/es-VE/admin.yml b/config/locales/es-VE/admin.yml
index ce59ead1e..6da4ba856 100644
--- a/config/locales/es-VE/admin.yml
+++ b/config/locales/es-VE/admin.yml
@@ -773,7 +773,7 @@ es-VE:
search:
title: Buscar Organizaciones
no_results: No se han encontrado organizaciones.
- proposals:
+ hidden_proposals:
index:
filter: Filtro
filters:
diff --git a/config/locales/es/activerecord.yml b/config/locales/es/activerecord.yml
index 15bbb35bf..bf4133daa 100644
--- a/config/locales/es/activerecord.yml
+++ b/config/locales/es/activerecord.yml
@@ -10,12 +10,12 @@ es:
budget/investment:
one: "Proyecto de gasto"
other: "Proyectos de gasto"
- budget/investment/milestone:
+ milestone:
one: "hito"
other: "hitos"
- budget/investment/status:
- one: "Estado del proyecto"
- other: "Estados del proyecto"
+ milestone/status:
+ one: "Estado de seguimiento"
+ other: "Estados de seguimiento"
comment:
one: "Comentario"
other: "Comentarios"
@@ -82,9 +82,6 @@ es:
legislation/draft_versions:
one: "Versión borrador"
other: "Versiones borrador"
- legislation/draft_texts:
- one: "Borrador"
- other: "Borradores"
legislation/questions:
one: "Pregunta"
other: "Preguntas"
@@ -131,12 +128,12 @@ es:
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
image: "Imagen descriptiva del proyecto de gasto"
image_title: "Título de la imagen"
- budget/investment/milestone:
+ milestone:
status_id: "Estado actual del proyecto (opcional)"
title: "Título"
description: "Descripción (opcional si hay un estado asignado)"
publication_date: "Fecha de publicación"
- budget/investment/status:
+ milestone/status:
name: "Nombre"
description: "Descripción (opcional)"
budget/heading:
diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml
index 7fec85f34..784b213d0 100644
--- a/config/locales/es/admin.yml
+++ b/config/locales/es/admin.yml
@@ -289,24 +289,24 @@ es:
notice: Hito borrado correctamente
statuses:
index:
- title: Estados de proyectos
- empty_statuses: Aún no se ha creado ningún estado de proyecto
- new_status: Crear nuevo estado de proyecto
+ title: Estados de seguimiento
+ empty_statuses: Aún no se ha creado ningún estado de seguimiento
+ new_status: Crear nuevo estado de seguimiento
table_name: Nombre
table_description: Descripción
table_actions: Acciones
delete: Borrar
edit: Editar
edit:
- title: Editar estado de proyecto
+ title: Editar estado de seguimiento
update:
- notice: Estado de proyecto editado correctamente
+ notice: Estado de seguimiento editado correctamente
new:
- title: Crear estado de proyecto
+ title: Crear estado de seguimiento
create:
- notice: Estado de proyecto creado correctamente
+ notice: Estado de seguimiento creado correctamente
delete:
- notice: Estado de proyecto eliminado correctamente
+ notice: Estado de seguimiento eliminado correctamente
comments:
index:
filter: Filtro
@@ -416,7 +416,7 @@ es:
status_planned: Próximamente
subnav:
info: Información
- draft_texts: Redacción
+ draft_versions: Redacción
questions: Debate
proposals: Propuestas
proposals:
@@ -1036,7 +1036,7 @@ es:
search:
title: Buscar Organizaciones
no_results: No se han encontrado organizaciones.
- proposals:
+ hidden_proposals:
index:
filter: Filtro
filters:
diff --git a/config/locales/es/pages.yml b/config/locales/es/pages.yml
index 739c93a26..5e16e4a4f 100644
--- a/config/locales/es/pages.yml
+++ b/config/locales/es/pages.yml
@@ -4,7 +4,6 @@ es:
title: Condiciones de uso
subtitle: AVISO LEGAL SOBRE LAS CONDICIONES DE USO, PRIVACIDAD Y PROTECCIÓN DE DATOS PERSONALES DEL PORTAL DE GOBIERNO ABIERTO
description: Página de información sobre las condiciones de uso, privacidad y protección de datos personales.
- general_terms: Términos y Condiciones
help:
title: "%{org} es una plataforma de participación ciudadana"
guide: "Esta guía explica para qué sirven y cómo funcionan cada una de las secciones de %{org}."
diff --git a/config/locales/es/settings.yml b/config/locales/es/settings.yml
index 3e9c926c6..f0dff19f7 100644
--- a/config/locales/es/settings.yml
+++ b/config/locales/es/settings.yml
@@ -20,7 +20,9 @@ es:
max_votes_for_debate_edit_description: "A partir de este número de votos el autor de un Debate ya no podrá editarlo"
proposal_code_prefix: "Prefijo para los códigos de Propuestas"
proposal_code_prefix_description: "Este prefijo aparecerá en las Propuestas delante de la fecha de creación y su ID"
- votes_for_proposal_success: "Número de votos necesarios para aprobar una Propuesta"
+ featured_proposals_number: "Número de propuestas destacadas"
+ featured_proposals_number_description: "Número de propuestas destacadas que se mostrarán si la funcionalidad Propuestas destacadas está activa"
+ votes_for_proposal_success: "Número de apoyos necesarios para aprobar una Propuesta"
votes_for_proposal_success_description: "Cuando una propuesta alcance este número de apoyos ya no podrá recibir más y se considera exitosa"
months_to_archive_proposals: "Meses para archivar las Propuestas"
months_to_archive_proposals_description: Pasado este número de meses las Propuestas se archivarán y ya no podrán recoger apoyos
@@ -85,6 +87,8 @@ es:
google_login_description: "Permitir que los usuarios se registren con su cuenta de Google"
proposals: "Propuestas"
proposals_description: "Las propuestas ciudadanas son una oportunidad para que los vecinos y colectivos decidan directamente cómo quieren que sea su ciudad, después de conseguir los apoyos suficientes y de someterse a votación ciudadana"
+ featured_proposals: "Propuestas destacadas"
+ featured_proposals_description: "Muestra propuestas destacadas en la página principal de propuestas"
debates: "Debates"
debates_description: "El espacio de debates ciudadanos está dirigido a que cualquier persona pueda exponer temas que le preocupan y sobre los que quiera compartir puntos de vista con otras personas"
polls: "Votaciones"
diff --git a/config/locales/fa-IR/activerecord.yml b/config/locales/fa-IR/activerecord.yml
index e7baab9b0..4a417cc80 100644
--- a/config/locales/fa-IR/activerecord.yml
+++ b/config/locales/fa-IR/activerecord.yml
@@ -10,7 +10,7 @@ fa:
budget/investment:
one: "سرمایه گذاری"
other: "سرمایه گذاری ها"
- budget/investment/milestone:
+ milestone:
one: "نقطه عطف"
other: "نقاط عطف"
comment:
@@ -119,7 +119,7 @@ fa:
organization_name: "اگر شما به نام یک گروه / سازمان، یا از طرف افراد بیشتری پیشنهاد می کنید، نام آنها را بنویسید."
image: "تصویر طرح توصیفی"
image_title: "عنوان تصویر"
- budget/investment/milestone:
+ milestone:
title: "عنوان"
publication_date: "تاریخ انتشار"
budget/heading:
diff --git a/config/locales/fa-IR/admin.yml b/config/locales/fa-IR/admin.yml
index 5181924f0..d80d5edee 100644
--- a/config/locales/fa-IR/admin.yml
+++ b/config/locales/fa-IR/admin.yml
@@ -863,7 +863,7 @@ fa:
search:
title: جستجو سازمان ها
no_results: هیچ سازمان یافت نشد
- proposals:
+ hidden_proposals:
index:
filter: فیلتر
filters:
diff --git a/config/locales/fr/activerecord.yml b/config/locales/fr/activerecord.yml
index 0b9540d10..247cdffb5 100644
--- a/config/locales/fr/activerecord.yml
+++ b/config/locales/fr/activerecord.yml
@@ -10,10 +10,10 @@ fr:
budget/investment:
one: "Projet d'investissement"
other: "Projets d'investissement"
- budget/investment/milestone:
+ milestone:
one: "jalon"
other: "jalons"
- budget/investment/status:
+ milestone/status:
one: "Statut d’investissement"
other: "Statuts d’investissement"
comment:
@@ -128,12 +128,12 @@ fr:
organization_name: "Si votre proposition se fait au nom d'un collectif ou d'une organisation, renseignez leur nom"
image: "Image descriptive de la proposition"
image_title: "Titre de l'image"
- budget/investment/milestone:
+ milestone:
status_id: "Statut actuel de l'investissement (facultatif)"
title: "Titre"
description: "Description (facultative si un statut est affecté)"
publication_date: "Date de publication"
- budget/investment/status:
+ milestone/status:
name: "Nom"
description: "Description (facultative)"
budget/heading:
diff --git a/config/locales/fr/admin.yml b/config/locales/fr/admin.yml
index bdc103d47..069cdabd3 100644
--- a/config/locales/fr/admin.yml
+++ b/config/locales/fr/admin.yml
@@ -402,7 +402,7 @@ fr:
status_planned: Planifié
subnav:
info: Information
- draft_texts: Brouillon
+ draft_versions: Brouillon
questions: Débat
proposals: Propositions
proposals:
@@ -1006,7 +1006,7 @@ fr:
search:
title: Rechercher une organisation
no_results: Aucune organisation trouvée.
- proposals:
+ hidden_proposals:
index:
filter: Filtrer
filters:
diff --git a/config/locales/gl/activerecord.yml b/config/locales/gl/activerecord.yml
index bef16f4db..725778290 100644
--- a/config/locales/gl/activerecord.yml
+++ b/config/locales/gl/activerecord.yml
@@ -10,10 +10,10 @@ gl:
budget/investment:
one: "Investimento"
other: "Investimentos"
- budget/investment/milestone:
+ milestone:
one: "fito"
other: "fitos"
- budget/investment/status:
+ milestone/status:
one: "Estado do investimento"
other: "Estado dos investimentos"
comment:
@@ -131,12 +131,12 @@ gl:
organization_name: "Se estás a propor no nome dunha organización, dun colectivo ou de mais xente, escribe o seu nome"
image: "Imaxe descritiva da proposta"
image_title: "Título da imaxe"
- budget/investment/milestone:
+ milestone:
status_id: "Estado do investimento actual (opcional)"
title: "Título"
description: "Descrición (opcional se hai unha condición asignada)"
publication_date: "Data de publicación"
- budget/investment/status:
+ milestone/status:
name: "Nome"
description: "Descrición (opcional)"
budget/heading:
diff --git a/config/locales/gl/admin.yml b/config/locales/gl/admin.yml
index 341aef52f..d90fd9849 100644
--- a/config/locales/gl/admin.yml
+++ b/config/locales/gl/admin.yml
@@ -411,7 +411,7 @@ gl:
status_planned: Planificado
subnav:
info: Información
- draft_texts: Redacción
+ draft_versions: Redacción
questions: Debate
proposals: Propostas
proposals:
@@ -1028,7 +1028,7 @@ gl:
search:
title: Buscar organizacións
no_results: Non se atoparon organizacións.
- proposals:
+ hidden_proposals:
index:
filter: Filtro
filters:
diff --git a/config/locales/he/admin.yml b/config/locales/he/admin.yml
index 77789491e..389ecac1a 100644
--- a/config/locales/he/admin.yml
+++ b/config/locales/he/admin.yml
@@ -228,7 +228,7 @@ he:
verify: Verify
search:
title: Search Organisations
- proposals:
+ hidden_proposals:
index:
filter: Filter
filters:
diff --git a/config/locales/id-ID/activerecord.yml b/config/locales/id-ID/activerecord.yml
index 66b109b6b..eae0f72cf 100644
--- a/config/locales/id-ID/activerecord.yml
+++ b/config/locales/id-ID/activerecord.yml
@@ -7,7 +7,7 @@ id:
other: "Anggaran"
budget/investment:
other: "Investasi"
- budget/investment/milestone:
+ milestone:
other: "batu peringatan"
comment:
other: "Komentar"
@@ -81,7 +81,7 @@ id:
organization_name: "Jika Anda usulkan dalam nama kolektif/organisasi, atau atas nama orang lain, menulis namanya"
image: "Gambar deskriptif proposal"
image_title: "Judul gambar"
- budget/investment/milestone:
+ milestone:
title: "Judul"
publication_date: "Tanggal publikasi"
budget/heading:
diff --git a/config/locales/id-ID/admin.yml b/config/locales/id-ID/admin.yml
index edba75f62..cc0748d22 100644
--- a/config/locales/id-ID/admin.yml
+++ b/config/locales/id-ID/admin.yml
@@ -738,7 +738,7 @@ id:
search:
title: Cari organisasi
no_results: Tidak ada organisasi yang ditemukan.
- proposals:
+ hidden_proposals:
index:
filters:
with_confirmed_hide: Dikonfirmasi
diff --git a/config/locales/it/activerecord.yml b/config/locales/it/activerecord.yml
index 7de92dc08..84c494e0b 100644
--- a/config/locales/it/activerecord.yml
+++ b/config/locales/it/activerecord.yml
@@ -10,10 +10,10 @@ it:
budget/investment:
one: "Investimento"
other: "Investimenti"
- budget/investment/milestone:
+ milestone:
one: "traguardo"
other: "traguardi"
- budget/investment/status:
+ milestone/status:
one: "Status dell’investimento"
other: "Status dell’investimento"
comment:
@@ -128,12 +128,12 @@ it:
organization_name: "Se presenti una proposta a nome di un collettivo o di un’organizzazione, ovvero per conto di più persone, indicane il nome"
image: "Immagine descrittiva della proposta"
image_title: "Titolo dell’immagine"
- budget/investment/milestone:
+ milestone:
status_id: "Stato attuale dell’investimento (facoltativo)"
title: "Titolo"
description: "Descrizione (facoltativa se c’è gia uno stato assegnato)"
publication_date: "Data di pubblicazione"
- budget/investment/status:
+ milestone/status:
name: "Nome"
description: "Descrizione (facoltativa)"
budget/heading:
diff --git a/config/locales/it/admin.yml b/config/locales/it/admin.yml
index 064d2002c..840d6cb53 100644
--- a/config/locales/it/admin.yml
+++ b/config/locales/it/admin.yml
@@ -402,7 +402,7 @@ it:
status_planned: Programmato
subnav:
info: Informazione
- draft_texts: Redazione
+ draft_versions: Redazione
questions: Dibattito
proposals: Proposte
proposals:
@@ -1009,7 +1009,7 @@ it:
search:
title: Cerca Organizzazioni
no_results: Nessuna organizzazione trovata.
- proposals:
+ hidden_proposals:
index:
filter: Filtra
filters:
diff --git a/config/locales/nl/activerecord.yml b/config/locales/nl/activerecord.yml
index 7cc9b19c3..559462b88 100644
--- a/config/locales/nl/activerecord.yml
+++ b/config/locales/nl/activerecord.yml
@@ -10,7 +10,7 @@ nl:
budget/investment:
one: "Investerning"
other: "Investeringen"
- budget/investment/milestone:
+ milestone:
one: "mijlpaal"
other: "mijlpalen"
comment:
@@ -122,12 +122,12 @@ nl:
organization_name: "Als je een voorstel doet uit naam van een collectief/organisatie, voer dan hier de naam in"
image: "Afbeelding ter omschrijving van het voorstel"
image_title: "Naam van de afbeelding"
- budget/investment/milestone:
+ milestone:
status_id: "Huidige investeringsstatus (optioneel)"
title: "Titel"
description: "Omschrijving"
publication_date: "Publicatiedatum"
- budget/investment/status:
+ milestone/status:
name: "Naam"
description: "Beschrijving (optioneel)"
budget/heading:
diff --git a/config/locales/nl/admin.yml b/config/locales/nl/admin.yml
index e8609b609..e6267fcea 100644
--- a/config/locales/nl/admin.yml
+++ b/config/locales/nl/admin.yml
@@ -403,7 +403,7 @@ nl:
status_planned: Gepland
subnav:
info: Informatie
- draft_texts: Tekst
+ draft_versions: Tekst
questions: Debat
proposals: Voorstellen
proposals:
@@ -1010,7 +1010,7 @@ nl:
search:
title: Zoek Organisaties
no_results: Geen organisaties gevonden.
- proposals:
+ hidden_proposals:
index:
filter: Filter
filters:
diff --git a/config/locales/pl-PL/activerecord.yml b/config/locales/pl-PL/activerecord.yml
index c16b494d1..e8a63da98 100644
--- a/config/locales/pl-PL/activerecord.yml
+++ b/config/locales/pl-PL/activerecord.yml
@@ -6,12 +6,12 @@ pl:
few: "Inwestycje"
many: "Inwestycji"
other: "Inwestycji"
- budget/investment/milestone:
+ milestone:
one: "kamień milowy"
few: "kamienie milowe"
many: "kamieni milowych"
other: "kamieni milowych"
- budget/investment/status:
+ milestone/status:
one: "Etap inwestycji"
few: "Etapy inwestycji"
many: "Etapów inwestycji"
@@ -158,12 +158,12 @@ pl:
organization_name: "Jeśli wnioskujesz w imieniu zespołu/organizacji, lub w imieniu większej liczby osób, wpisz ich nazwę"
image: "Opisowy obraz wniosku"
image_title: "Tytuł obrazu"
- budget/investment/milestone:
+ milestone:
status_id: "Bieżący stan inwestycji (opcjonalnie)"
title: "Tytuł"
description: "Opis (opcjonalnie, jeśli istnieje przydzielony stan)"
publication_date: "Data publikacji"
- budget/investment/status:
+ milestone/status:
name: "Nazwa"
description: "Opis (opcjonalnie)"
budget/heading:
diff --git a/config/locales/pl-PL/admin.yml b/config/locales/pl-PL/admin.yml
index b59aae930..81104831d 100644
--- a/config/locales/pl-PL/admin.yml
+++ b/config/locales/pl-PL/admin.yml
@@ -408,7 +408,7 @@ pl:
status_planned: Zaplanowany
subnav:
info: Informacje
- draft_texts: Opracowanie
+ draft_versions: Opracowanie
questions: Debata
proposals: Wnioski
proposals:
@@ -1014,7 +1014,7 @@ pl:
search:
title: Szukaj organizacji
no_results: Nie znaleziono organizacji.
- proposals:
+ hidden_proposals:
index:
filter: Filtr
filters:
diff --git a/config/locales/pt-BR/activerecord.yml b/config/locales/pt-BR/activerecord.yml
index 93756f2fc..91fcd3dbc 100644
--- a/config/locales/pt-BR/activerecord.yml
+++ b/config/locales/pt-BR/activerecord.yml
@@ -10,10 +10,10 @@ pt-BR:
budget/investment:
one: "Investimento"
other: "Investimentos"
- budget/investment/milestone:
+ milestone:
one: "Marco"
other: "Marcos"
- budget/investment/status:
+ milestone/status:
one: "Status de investimento"
other: "Status dos investimentos"
comment:
@@ -128,12 +128,12 @@ pt-BR:
organization_name: "Se você está propondo em nome de um coletivo / organização, ou em nome de mais pessoas, escreva seu nome"
image: "Imagem descritiva da proposta"
image_title: "Título da imagem"
- budget/investment/milestone:
+ milestone:
status_id: "Status atual do investimento (opcional)"
title: "Título"
description: "Descrição (opcional, se houver uma condição atribuída)"
publication_date: "Data de publicação"
- budget/investment/status:
+ milestone/status:
name: "Nome"
description: "Descrição (opcional)"
budget/heading:
diff --git a/config/locales/pt-BR/admin.yml b/config/locales/pt-BR/admin.yml
index 7d9a975b3..2d5457e3b 100644
--- a/config/locales/pt-BR/admin.yml
+++ b/config/locales/pt-BR/admin.yml
@@ -404,7 +404,7 @@ pt-BR:
status_planned: Planejados
subnav:
info: Informação
- draft_texts: Seleção
+ draft_versions: Seleção
questions: Debate
proposals: Propostas
proposals:
@@ -1013,7 +1013,7 @@ pt-BR:
search:
title: Buscar Organizações
no_results: Nenhuma organização encontrada.
- proposals:
+ hidden_proposals:
index:
filter: Filtro
filters:
diff --git a/config/locales/ru/activerecord.yml b/config/locales/ru/activerecord.yml
index efecc08c2..a97e2e69d 100644
--- a/config/locales/ru/activerecord.yml
+++ b/config/locales/ru/activerecord.yml
@@ -22,12 +22,12 @@ ru:
organization_name: "Если вы делаете предложение от имени коллектива/организации или от имени большего числа людей, напишите его название"
image: "Иллюстративное изображение предложения"
image_title: "Название изображения"
- budget/investment/milestone:
+ milestone:
status_id: "Текущий инвестиционный статус (опционально)"
title: "Название"
description: "Описание (опционально, если присвоен статус)"
publication_date: "Дата публикации"
- budget/investment/status:
+ milestone/status:
name: "Имя"
description: "Описание (опционально)"
budget/heading:
diff --git a/config/locales/sq-AL/activerecord.yml b/config/locales/sq-AL/activerecord.yml
index 8eaf2af24..e8882ffcc 100644
--- a/config/locales/sq-AL/activerecord.yml
+++ b/config/locales/sq-AL/activerecord.yml
@@ -10,10 +10,10 @@ sq:
budget/investment:
one: "Investim"
other: "Investim"
- budget/investment/milestone:
+ milestone:
one: "moment historik"
other: "milestone"
- budget/investment/status:
+ milestone/status:
one: "Statusi investimeve"
other: "Statusi investimeve"
comment:
@@ -128,12 +128,12 @@ sq:
organization_name: "Nëse propozoni në emër të një kolektivi / organizate, ose në emër të më shumë njerëzve, shkruani emrin e tij"
image: "Imazhi përshkrues i propozimit"
image_title: "Titulli i imazhit"
- budget/investment/milestone:
+ milestone:
status_id: "Statusi aktual i investimit (opsional)"
title: "Titull"
description: "Përshkrimi (opsional nëse ka status të caktuar)"
publication_date: "Data e publikimit"
- budget/investment/status:
+ milestone/status:
name: "Emri"
description: "Përshkrimi (opsional)"
budget/heading:
diff --git a/config/locales/sq-AL/admin.yml b/config/locales/sq-AL/admin.yml
index 6ec432ca8..74f25c2db 100644
--- a/config/locales/sq-AL/admin.yml
+++ b/config/locales/sq-AL/admin.yml
@@ -404,7 +404,7 @@ sq:
status_planned: Planifikuar
subnav:
info: Informacion
- draft_texts: Hartimi
+ draft_versions: Hartimi
questions: Debate
proposals: Propozime
proposals:
@@ -1013,7 +1013,7 @@ sq:
search:
title: Kërko Organizatat
no_results: Asnjë organizatë nuk u gjet.
- proposals:
+ hidden_proposals:
index:
filter: Filtër
filters:
diff --git a/config/locales/sv-SE/activerecord.yml b/config/locales/sv-SE/activerecord.yml
index 47f0e9a49..4dd7cf5c6 100644
--- a/config/locales/sv-SE/activerecord.yml
+++ b/config/locales/sv-SE/activerecord.yml
@@ -10,10 +10,10 @@ sv:
budget/investment:
one: "Budgetförslag"
other: "Budgetförslag"
- budget/investment/milestone:
+ milestone:
one: "milstolpe"
other: "milstolpar"
- budget/investment/status:
+ milestone/status:
one: "Budgetförslagets status"
other: "Budgetförslagens status"
comment:
@@ -128,12 +128,12 @@ sv:
organization_name: "Organisation eller grupp i vars namn du lämnar förslaget"
image: "Förklarande bild till förslaget"
image_title: "Bildtext"
- budget/investment/milestone:
+ milestone:
status_id: "Nuvarande status för budgetförslag (frivilligt fält)"
title: "Titel"
description: "Beskrivning (frivilligt fält om projektets status har ställts in)"
publication_date: "Publiceringsdatum"
- budget/investment/status:
+ milestone/status:
name: "Namn"
description: "Beskrivning (frivilligt fält)"
budget/heading:
diff --git a/config/locales/sv-SE/admin.yml b/config/locales/sv-SE/admin.yml
index 2789798a0..4e6d49059 100644
--- a/config/locales/sv-SE/admin.yml
+++ b/config/locales/sv-SE/admin.yml
@@ -403,7 +403,7 @@ sv:
status_planned: Planerad
subnav:
info: Information
- draft_texts: Utkast
+ draft_versions: Utkast
questions: Diskussion
proposals: Förslag
proposals:
@@ -1008,7 +1008,7 @@ sv:
search:
title: Sök organisationer
no_results: Inga organisationer.
- proposals:
+ hidden_proposals:
index:
filter: Filtrera
filters:
diff --git a/config/locales/tr-TR/activerecord.yml b/config/locales/tr-TR/activerecord.yml
index 160579200..46e4fd8cd 100644
--- a/config/locales/tr-TR/activerecord.yml
+++ b/config/locales/tr-TR/activerecord.yml
@@ -10,7 +10,7 @@ tr:
budget/investment:
one: "yatırım"
other: "Yatırımlar"
- budget/investment/milestone:
+ milestone:
one: "kilometre taşı"
other: "kilometre taşları"
comment:
diff --git a/config/locales/val/activerecord.yml b/config/locales/val/activerecord.yml
index 7231bd73f..eac2133b8 100644
--- a/config/locales/val/activerecord.yml
+++ b/config/locales/val/activerecord.yml
@@ -10,10 +10,10 @@ val:
budget/investment:
one: "Proposta d'inversió"
other: "Propostes d'inversió"
- budget/investment/milestone:
+ milestone:
one: "fita"
other: "fites"
- budget/investment/status:
+ milestone/status:
one: "Estat de la proposta"
other: "Estat de les propostes"
comment:
@@ -131,12 +131,12 @@ val:
organization_name: "Si estàs proposant en nom d'una associació o col·lectiu, escriu el seu nom"
image: "Imatge descriptiva de la proposta d'inversió"
image_title: "Títol de la imatge"
- budget/investment/milestone:
+ milestone:
status_id: "Estat actual de la proposta (opcional)"
title: "Títol"
description: "Descripció (opcional si hi ha un estat asignat)"
publication_date: "Data de publicació"
- budget/investment/status:
+ milestone/status:
name: "Nom"
description: "Descripció (opcional)"
budget/heading:
diff --git a/config/locales/val/admin.yml b/config/locales/val/admin.yml
index 71fc42fe0..57dea5b0d 100644
--- a/config/locales/val/admin.yml
+++ b/config/locales/val/admin.yml
@@ -401,7 +401,7 @@ val:
status_planned: Pròximament
subnav:
info: Informació
- draft_texts: Text
+ draft_versions: Text
questions: Debat
proposals: Propostes
proposals:
@@ -972,7 +972,7 @@ val:
search:
title: Cercar Organitzacions
no_results: No s'han trobat organitzacions.
- proposals:
+ hidden_proposals:
index:
filter: Filtre
filters:
diff --git a/config/locales/zh-CN/activerecord.yml b/config/locales/zh-CN/activerecord.yml
index 90f1f94ec..ca8972641 100644
--- a/config/locales/zh-CN/activerecord.yml
+++ b/config/locales/zh-CN/activerecord.yml
@@ -7,9 +7,9 @@ zh-CN:
other: "预算"
budget/investment:
other: "投资"
- budget/investment/milestone:
+ milestone:
other: "里程碑"
- budget/investment/status:
+ milestone/status:
other: "投资状态"
comment:
other: "意见"
@@ -93,12 +93,12 @@ zh-CN:
organization_name: "如果你是以集体/组织的名义或者代表更多的人提出建议,写下它的名字。"
image: "建议说明性图像"
image_title: "图像标题"
- budget/investment/milestone:
+ milestone:
status_id: "当前投资状况(可选)"
title: "标题"
description: "说明(如果指定了状态,则可选)"
publication_date: "出版日期"
- budget/investment/status:
+ milestone/status:
name: "名字"
description: "说明(可选)"
budget/heading:
diff --git a/config/locales/zh-CN/admin.yml b/config/locales/zh-CN/admin.yml
index ec24af62e..10bc7eb00 100644
--- a/config/locales/zh-CN/admin.yml
+++ b/config/locales/zh-CN/admin.yml
@@ -401,7 +401,7 @@ zh-CN:
status_planned: 计划
subnav:
info: 信息
- draft_texts: 起草
+ draft_versions: 起草
questions: 辩论
proposals: 提议
proposals:
@@ -1007,7 +1007,7 @@ zh-CN:
search:
title: 搜索组织
no_results: 未找到任何组织。
- proposals:
+ hidden_proposals:
index:
filter: 过滤器
filters:
diff --git a/config/locales/zh-TW/activerecord.yml b/config/locales/zh-TW/activerecord.yml
index cebb171a9..1840ee3f7 100644
--- a/config/locales/zh-TW/activerecord.yml
+++ b/config/locales/zh-TW/activerecord.yml
@@ -7,9 +7,9 @@ zh-TW:
other: "預算"
budget/investment:
other: "投資"
- budget/investment/milestone:
+ milestone:
other: "里程碑"
- budget/investment/status:
+ milestone/status:
other: "投資狀態"
comment:
other: "評論"
@@ -93,12 +93,12 @@ zh-TW:
organization_name: "如果您以集體/組織的名義,或代表多人提出建議,請寫下其名稱"
image: "建議說明性圖像"
image_title: "圖像標題"
- budget/investment/milestone:
+ milestone:
status_id: "當前投資狀況 (可選擇填寫)"
title: "標題"
description: "說明 (如果已經指定了狀態, 則可選擇填寫)"
publication_date: "出版日期"
- budget/investment/status:
+ milestone/status:
name: "名字"
description: "說明 (可選擇填寫)"
budget/heading:
diff --git a/config/locales/zh-TW/admin.yml b/config/locales/zh-TW/admin.yml
index 8756ab394..4e56527b4 100644
--- a/config/locales/zh-TW/admin.yml
+++ b/config/locales/zh-TW/admin.yml
@@ -402,7 +402,7 @@ zh-TW:
status_planned: 計劃
subnav:
info: 資訊
- draft_texts: 起草
+ draft_versions: 起草
questions: 辯論
proposals: 建議
proposals:
@@ -1010,7 +1010,7 @@ zh-TW:
search:
title: 搜尋組織
no_results: 未找到任何組織。
- proposals:
+ hidden_proposals:
index:
filter: 篩選器
filters:
diff --git a/config/routes/admin.rb b/config/routes/admin.rb
index d8425ecf9..a6ccf2de3 100644
--- a/config/routes/admin.rb
+++ b/config/routes/admin.rb
@@ -29,7 +29,7 @@ namespace :admin do
end
end
- resources :proposals, only: :index do
+ resources :hidden_proposals, only: :index do
member do
put :restore
put :confirm_hide
@@ -62,14 +62,14 @@ namespace :admin do
end
resources :budget_investments, only: [:index, :show, :edit, :update] do
- resources :budget_investment_milestones
+ resources :milestones, controller: 'budget_investment_milestones'
member { patch :toggle_selection }
end
resources :budget_phases, only: [:edit, :update]
end
- resources :budget_investment_statuses, only: [:index, :new, :create, :update, :edit, :destroy]
+ resources :milestone_statuses, only: [:index, :new, :create, :update, :edit, :destroy]
resources :signature_sheets, only: [:index, :new, :create, :show]
diff --git a/config/routes/budget.rb b/config/routes/budget.rb
index 475d5496a..0159b946a 100644
--- a/config/routes/budget.rb
+++ b/config/routes/budget.rb
@@ -25,3 +25,4 @@ scope '/participatory_budget' do
end
get 'investments/:id/json_data', action: :json_data, controller: 'budgets/investments'
+get '/budgets/:budget_id/investments/:id/json_data', action: :json_data, controller: 'budgets/investments'
diff --git a/config/sitemap.rb b/config/sitemap.rb
index a5e72e2b1..85aeee2a2 100644
--- a/config/sitemap.rb
+++ b/config/sitemap.rb
@@ -10,11 +10,6 @@ SitemapGenerator::Sitemap.default_host = Setting["url"]
# sitemap generator
SitemapGenerator::Sitemap.create do
- pages = ["general_terms"]
- pages.each do |page|
- add page_path(id: page)
- end
-
add help_path
add how_to_use_path
add faq_path
diff --git a/db/dev_seeds/budgets.rb b/db/dev_seeds/budgets.rb
index 6a44b977c..cb1a17ed7 100644
--- a/db/dev_seeds/budgets.rb
+++ b/db/dev_seeds/budgets.rb
@@ -40,21 +40,31 @@ section "Creating Budgets" do
city_group = budget.groups.create!(name: I18n.t('seeds.budgets.groups.all_city'))
city_group.headings.create!(name: I18n.t('seeds.budgets.groups.all_city'),
price: 1000000,
- population: 1000000)
+ population: 1000000,
+ latitude: '-40.123241',
+ longitude: '25.123249')
districts_group = budget.groups.create!(name: I18n.t('seeds.budgets.groups.districts'))
districts_group.headings.create!(name: I18n.t('seeds.geozones.north_district'),
price: rand(5..10) * 100000,
- population: 350000)
+ population: 350000,
+ latitude: '15.234521',
+ longitude: '-15.234234')
districts_group.headings.create!(name: I18n.t('seeds.geozones.west_district'),
price: rand(5..10) * 100000,
- population: 300000)
+ population: 300000,
+ latitude: '14.125125',
+ longitude: '65.123124')
districts_group.headings.create!(name: I18n.t('seeds.geozones.east_district'),
price: rand(5..10) * 100000,
- population: 200000)
+ population: 200000,
+ latitude: '23.234234',
+ longitude: '-47.134124')
districts_group.headings.create!(name: I18n.t('seeds.geozones.central_district'),
price: rand(5..10) * 100000,
- population: 150000)
+ population: 150000,
+ latitude: '-26.133213',
+ longitude: '-10.123231')
end
end
@@ -139,16 +149,16 @@ section "Creating Valuation Assignments" do
end
end
-section "Creating default Investment Milestone Statuses" do
- Budget::Investment::Status.create(name: I18n.t('seeds.budgets.statuses.studying_project'))
- Budget::Investment::Status.create(name: I18n.t('seeds.budgets.statuses.bidding'))
- Budget::Investment::Status.create(name: I18n.t('seeds.budgets.statuses.executing_project'))
- Budget::Investment::Status.create(name: I18n.t('seeds.budgets.statuses.executed'))
+section "Creating default Milestone Statuses" do
+ Milestone::Status.create(name: I18n.t('seeds.budgets.statuses.studying_project'))
+ Milestone::Status.create(name: I18n.t('seeds.budgets.statuses.bidding'))
+ Milestone::Status.create(name: I18n.t('seeds.budgets.statuses.executing_project'))
+ Milestone::Status.create(name: I18n.t('seeds.budgets.statuses.executed'))
end
section "Creating investment milestones" do
Budget::Investment.find_each do |investment|
- milestone = Budget::Investment::Milestone.new(investment_id: investment.id, publication_date: Date.tomorrow)
+ milestone = investment.milestones.build(publication_date: Date.tomorrow, status_id: Milestone::Status.all.sample)
I18n.available_locales.map do |locale|
Globalize.with_locale(locale) do
milestone.description = "Description for locale #{locale}"
diff --git a/db/dev_seeds/settings.rb b/db/dev_seeds/settings.rb
index 388742217..ce9bdd7c2 100644
--- a/db/dev_seeds/settings.rb
+++ b/db/dev_seeds/settings.rb
@@ -30,6 +30,7 @@ section "Creating Settings" do
Setting.create(key: 'feature.debates', value: "true")
Setting.create(key: 'feature.proposals', value: "true")
+ Setting.create(key: 'feature.featured_proposals', value: "true")
Setting.create(key: 'feature.polls', value: "true")
Setting.create(key: 'feature.spending_proposals', value: nil)
Setting.create(key: 'feature.spending_proposal_features.voting_allowed', value: nil)
@@ -65,6 +66,8 @@ section "Creating Settings" do
Setting.create(key: 'map_latitude', value: 40.41)
Setting.create(key: 'map_longitude', value: -3.7)
Setting.create(key: 'map_zoom', value: 10)
+ Setting.create(key: 'featured_proposals_number', value: 3)
+
Setting.create(key: 'related_content_score_threshold', value: -0.3)
Setting['feature.homepage.widgets.feeds.proposals'] = true
diff --git a/db/migrate/20180323190027_add_translate_milestones.rb b/db/migrate/20180323190027_add_translate_milestones.rb
index 6767d8e84..afc8db9af 100644
--- a/db/migrate/20180323190027_add_translate_milestones.rb
+++ b/db/migrate/20180323190027_add_translate_milestones.rb
@@ -1,15 +1,12 @@
class AddTranslateMilestones < ActiveRecord::Migration
- def self.up
- Budget::Investment::Milestone.create_translation_table!(
- {
- title: :string,
- description: :text
- },
- { migrate_data: true }
- )
- end
+ def change
+ create_table :budget_investment_milestone_translations do |t|
+ t.integer :budget_investment_milestone_id, null: false
+ t.string :locale, null: false
+ t.string :title
+ t.text :description
- def self.down
- Budget::Investment::Milestone.drop_translation_table!
+ t.timestamps null: false
+ end
end
end
diff --git a/db/migrate/20180713103402_change_budget_investment_statuses_to_milestone_statuses.rb b/db/migrate/20180713103402_change_budget_investment_statuses_to_milestone_statuses.rb
new file mode 100644
index 000000000..05deae5a7
--- /dev/null
+++ b/db/migrate/20180713103402_change_budget_investment_statuses_to_milestone_statuses.rb
@@ -0,0 +1,12 @@
+class ChangeBudgetInvestmentStatusesToMilestoneStatuses < ActiveRecord::Migration
+ def change
+ create_table :milestone_statuses do |t|
+ t.string :name
+ t.text :description
+ t.datetime :hidden_at, index: true
+
+ t.timestamps null: false
+ end
+ end
+end
+
diff --git a/db/migrate/20180713124501_make_investment_milestones_polymorphic.rb b/db/migrate/20180713124501_make_investment_milestones_polymorphic.rb
new file mode 100644
index 000000000..9d8ce901e
--- /dev/null
+++ b/db/migrate/20180713124501_make_investment_milestones_polymorphic.rb
@@ -0,0 +1,27 @@
+class MakeInvestmentMilestonesPolymorphic < ActiveRecord::Migration
+ def change
+ create_table :milestones do |t|
+ t.references :milestoneable, polymorphic: true
+ t.string "title", limit: 80
+ t.text "description"
+ t.datetime "publication_date"
+
+ t.references :status, index: true
+
+ t.timestamps null: false
+ end
+
+ reversible do |change|
+ change.up do
+ Milestone.create_translation_table!({
+ title: :string,
+ description: :text
+ })
+ end
+
+ change.down do
+ Milestone.drop_translation_table!
+ end
+ end
+ end
+end
diff --git a/db/migrate/20181109111037_add_location_to_headings.rb b/db/migrate/20181109111037_add_location_to_headings.rb
new file mode 100644
index 000000000..973cdf38e
--- /dev/null
+++ b/db/migrate/20181109111037_add_location_to_headings.rb
@@ -0,0 +1,6 @@
+class AddLocationToHeadings < ActiveRecord::Migration
+ def change
+ add_column :budget_headings, :latitude, :text
+ add_column :budget_headings, :longitude, :text
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 6339ba480..4e384f9a9 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20181108142513) do
+ActiveRecord::Schema.define(version: 20181109111037) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -167,6 +167,8 @@ ActiveRecord::Schema.define(version: 20181108142513) do
t.integer "population"
t.string "slug"
t.boolean "allow_custom_content", default: false
+ t.text "latitude"
+ t.text "longitude"
end
add_index "budget_headings", ["group_id"], name: "index_budget_headings_on_group_id", using: :btree
@@ -174,15 +176,12 @@ ActiveRecord::Schema.define(version: 20181108142513) do
create_table "budget_investment_milestone_translations", force: :cascade do |t|
t.integer "budget_investment_milestone_id", null: false
t.string "locale", null: false
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
t.string "title"
t.text "description"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
end
- add_index "budget_investment_milestone_translations", ["budget_investment_milestone_id"], name: "index_6770e7675fe296cf87aa0fd90492c141b5269e0b", using: :btree
- add_index "budget_investment_milestone_translations", ["locale"], name: "index_budget_investment_milestone_translations_on_locale", using: :btree
-
create_table "budget_investment_milestones", force: :cascade do |t|
t.integer "investment_id"
t.string "title", limit: 80
@@ -792,6 +791,41 @@ ActiveRecord::Schema.define(version: 20181108142513) do
add_index "map_locations", ["investment_id"], name: "index_map_locations_on_investment_id", using: :btree
add_index "map_locations", ["proposal_id"], name: "index_map_locations_on_proposal_id", using: :btree
+ create_table "milestone_statuses", force: :cascade do |t|
+ t.string "name"
+ t.text "description"
+ t.datetime "hidden_at"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ end
+
+ add_index "milestone_statuses", ["hidden_at"], name: "index_milestone_statuses_on_hidden_at", using: :btree
+
+ create_table "milestone_translations", force: :cascade do |t|
+ t.integer "milestone_id", null: false
+ t.string "locale", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.string "title"
+ t.text "description"
+ end
+
+ add_index "milestone_translations", ["locale"], name: "index_milestone_translations_on_locale", using: :btree
+ add_index "milestone_translations", ["milestone_id"], name: "index_milestone_translations_on_milestone_id", using: :btree
+
+ create_table "milestones", force: :cascade do |t|
+ t.integer "milestoneable_id"
+ t.string "milestoneable_type"
+ t.string "title", limit: 80
+ t.text "description"
+ t.datetime "publication_date"
+ t.integer "status_id"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ end
+
+ add_index "milestones", ["status_id"], name: "index_milestones_on_status_id", using: :btree
+
create_table "moderators", force: :cascade do |t|
t.integer "user_id"
end
diff --git a/db/seeds.rb b/db/seeds.rb
index 8d4377c53..14f1ddaa6 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -72,6 +72,7 @@ Setting["meta_keywords"] = nil
# Feature flags
Setting['feature.debates'] = true
Setting['feature.proposals'] = true
+Setting['feature.featured_proposals'] = true
Setting['feature.spending_proposals'] = nil
Setting['feature.polls'] = true
Setting['feature.twitter_login'] = true
@@ -115,6 +116,9 @@ Setting['mailer_from_address'] = 'noreply@consul.dev'
Setting['verification_offices_url'] = 'http://oficinas-atencion-ciudadano.url/'
Setting['min_age_to_participate'] = 16
+# Featured proposals
+Setting['featured_proposals_number'] = 3
+
# Proposal improvement url path ('/help/proposal-improvement')
Setting['proposal_improvement_path'] = nil
@@ -132,3 +136,8 @@ Setting['feature.homepage.widgets.feeds.proposals'] = true
Setting['feature.homepage.widgets.feeds.debates'] = true
Setting['feature.homepage.widgets.feeds.processes'] = true
+WebSection.create(name: 'homepage')
+WebSection.create(name: 'debates')
+WebSection.create(name: 'proposals')
+WebSection.create(name: 'budgets')
+WebSection.create(name: 'help_page')
diff --git a/lib/migrate_spending_proposals_to_investments.rb b/lib/migrate_spending_proposals_to_investments.rb
index 908be8cc5..1f3fe1f39 100644
--- a/lib/migrate_spending_proposals_to_investments.rb
+++ b/lib/migrate_spending_proposals_to_investments.rb
@@ -8,10 +8,10 @@ class MigrateSpendingProposalsToInvestments
if sp.geozone_id.present?
group = budget.groups.find_or_create_by!(name: "Barrios")
- heading = group.headings.find_or_create_by!(name: sp.geozone.name, price: 10000000)
+ heading = group.headings.find_or_create_by!(name: sp.geozone.name, price: 10000000, latitude: '40.416775', longitude: '-3.703790')
else
group = budget.groups.find_or_create_by!(name: "Toda la ciudad")
- heading = group.headings.find_or_create_by!(name: "Toda la ciudad", price: 10000000)
+ heading = group.headings.find_or_create_by!(name: "Toda la ciudad", price: 10000000, latitude: '40.416775', longitude: '-3.703790')
end
feasibility = case sp.feasible
diff --git a/lib/tasks/globalize.rake b/lib/tasks/globalize.rake
index 51a23042e..5197b0b1d 100644
--- a/lib/tasks/globalize.rake
+++ b/lib/tasks/globalize.rake
@@ -3,7 +3,7 @@ namespace :globalize do
[
AdminNotification,
Banner,
- Budget::Investment::Milestone,
+ Milestone,
I18nContent,
Legislation::DraftVersion,
Legislation::Process,
diff --git a/lib/tasks/migrate_milestones_and_statuses.rake b/lib/tasks/migrate_milestones_and_statuses.rake
new file mode 100644
index 000000000..d01418e6b
--- /dev/null
+++ b/lib/tasks/migrate_milestones_and_statuses.rake
@@ -0,0 +1,106 @@
+namespace :milestones do
+
+ def generate_table_migration_sql(new_table:, old_table:, columns:)
+ from_cols = ['id', *columns.keys]
+ to_cols = ['id', *columns.values]
+ <<~SQL
+ INSERT INTO #{new_table} (#{to_cols.join(', ')})
+ SELECT #{from_cols.join(', ')} FROM #{old_table};
+ SQL
+ end
+
+ def migrate_table!(new_table:, old_table:, columns:)
+ puts "Migrating data from '#{old_table}' to '#{new_table}'..."
+ result = ActiveRecord::Base.connection.execute(
+ generate_table_migration_sql(old_table: old_table,
+ new_table: new_table,
+ columns: columns)
+
+ )
+ puts "#{result.cmd_tuples} rows affected"
+ end
+
+ def populate_column!(table:, column:, value:)
+ puts "Populating column '#{column}' from table '#{table}' with '#{value}'..."
+ result = ActiveRecord::Base.connection.execute(
+ "UPDATE #{table} SET #{column} = '#{value}';"
+ )
+ puts "#{result.cmd_tuples} rows affected"
+ end
+
+ def count_rows(table)
+ ActiveRecord::Base.connection.query("SELECT COUNT(*) FROM #{table};")[0][0].to_i
+ end
+
+ desc "Migrate milestones and milestone status data after making the model polymorphic"
+ task migrate: :environment do
+ # This script copies all milestone-related data from the old tables to
+ # the new ones (preserving all primary keys). All 3 of the new tables
+ # must be empty.
+ #
+ # To clear the new tables to test this script:
+ #
+ # DELETE FROM milestone_statuses;
+ # DELETE FROM milestones;
+ # DELETE FROM milestone_translations;
+ #
+
+ start = Time.now
+
+ ActiveRecord::Base.transaction do
+ migrate_table! old_table: 'budget_investment_statuses',
+ new_table: 'milestone_statuses',
+ columns: {'name' => 'name',
+ 'description' => 'description',
+ 'hidden_at' => 'hidden_at',
+ 'created_at' => 'created_at',
+ 'updated_at' => 'updated_at'}
+
+ migrate_table! old_table: 'budget_investment_milestones',
+ new_table: 'milestones',
+ columns: {'investment_id' => 'milestoneable_id',
+ 'title' => 'title',
+ 'description' => 'description',
+ 'created_at' => 'created_at',
+ 'updated_at' => 'updated_at',
+ 'publication_date' => 'publication_date',
+ 'status_id' => 'status_id'}
+
+ populate_column! table: 'milestones',
+ column: 'milestoneable_type',
+ value: 'Budget::Investment'
+
+ migrate_table! old_table: 'budget_investment_milestone_translations',
+ new_table: 'milestone_translations',
+ columns: {'budget_investment_milestone_id' => 'milestone_id',
+ 'locale' => 'locale',
+ 'created_at' => 'created_at',
+ 'updated_at' => 'updated_at',
+ 'title' => 'title',
+ 'description' => 'description'}
+
+ Image.where(imageable_type: "Budget::Investment::Milestone").
+ update_all(imageable_type: "Milestone")
+ Document.where(documentable_type: "Budget::Investment::Milestone").
+ update_all(documentable_type: "Milestone")
+
+ puts "Verifying that all rows were copied..."
+
+ {
+ "budget_investment_milestones" => "milestones",
+ "budget_investment_statuses" => "milestone_statuses",
+ "budget_investment_milestone_translations" => "milestone_translations"
+ }.each do |original_table, migrated_table|
+ ActiveRecord::Base.connection.execute(
+ "select setval('#{migrated_table}_id_seq', (select max(id) from #{migrated_table}));"
+ )
+
+ unless count_rows(original_table) == count_rows(migrated_table)
+ raise "Number of rows of old and new tables do not match! Rolling back transaction..."
+ end
+ end
+ end
+
+ puts "Finished in %.3f seconds" % (Time.now - start)
+ end
+end
diff --git a/lib/tasks/settings.rake b/lib/tasks/settings.rake
index ab33e5a36..729615133 100644
--- a/lib/tasks/settings.rake
+++ b/lib/tasks/settings.rake
@@ -25,4 +25,10 @@ namespace :settings do
Setting['feature.help_page'] = true
end
+ desc "Enable Featured proposals"
+ task enable_featured_proposals: :environment do
+ Setting['feature.featured_proposals'] = true
+ Setting['featured_proposals_number'] = 3
+ end
+
end
diff --git a/spec/factories/budgets.rb b/spec/factories/budgets.rb
index eaafde9a9..6f7a0680a 100644
--- a/spec/factories/budgets.rb
+++ b/spec/factories/budgets.rb
@@ -78,6 +78,8 @@ FactoryBot.define do
sequence(:name) { |n| "Heading #{n}" }
price 1000000
population 1234
+ latitude '-25.172741'
+ longitude '40.127241'
trait :drafting_budget do
association :group, factory: [:budget_group, :drafting_budget]
@@ -193,14 +195,14 @@ FactoryBot.define do
reason "unfeasible"
end
- factory :budget_investment_status, class: 'Budget::Investment::Status' do
- sequence(:name) { |n| "Budget investment status #{n} name" }
- sequence(:description) { |n| "Budget investment status #{n} description" }
+ factory :milestone_status, class: 'Milestone::Status' do
+ sequence(:name) { |n| "Milestone status #{n} name" }
+ sequence(:description) { |n| "Milestone status #{n} description" }
end
- factory :budget_investment_milestone, class: 'Budget::Investment::Milestone' do
- association :investment, factory: :budget_investment
- association :status, factory: :budget_investment_status
+ factory :milestone, class: 'Milestone' do
+ association :milestoneable, factory: :budget_investment
+ association :status, factory: :milestone_status
sequence(:title) { |n| "Budget investment milestone #{n} title" }
description 'Milestone description'
publication_date { Date.current }
diff --git a/spec/features/admin/activity_spec.rb b/spec/features/admin/activity_spec.rb
index 9cfd5f9b8..6f9270ffe 100644
--- a/spec/features/admin/activity_spec.rb
+++ b/spec/features/admin/activity_spec.rb
@@ -53,7 +53,7 @@ feature 'Admin activity' do
scenario "Shows admin restores" do
proposal = create(:proposal, :hidden)
- visit admin_proposals_path
+ visit admin_hidden_proposals_path
within("#proposal_#{proposal.id}") do
click_on "Restore"
diff --git a/spec/features/admin/budget_investment_milestones_spec.rb b/spec/features/admin/budget_investment_milestones_spec.rb
index 35ed69089..28b05ff03 100644
--- a/spec/features/admin/budget_investment_milestones_spec.rb
+++ b/spec/features/admin/budget_investment_milestones_spec.rb
@@ -5,22 +5,22 @@ feature 'Admin budget investment milestones' do
background do
admin = create(:administrator)
login_as(admin.user)
-
- @investment = create(:budget_investment)
end
+ let!(:investment) { create(:budget_investment) }
+
it_behaves_like "translatable",
- "budget_investment_milestone",
- "edit_admin_budget_budget_investment_budget_investment_milestone_path",
+ "milestone",
+ "edit_admin_budget_budget_investment_milestone_path",
%w[description]
context "Index" do
scenario 'Displaying milestones' do
- milestone = create(:budget_investment_milestone, investment: @investment)
+ milestone = create(:milestone, milestoneable: investment)
create(:image, imageable: milestone)
document = create(:document, documentable: milestone)
- visit admin_budget_budget_investment_path(@investment.budget, @investment)
+ visit admin_budget_budget_investment_path(investment.budget, investment)
expect(page).to have_content("Milestone")
expect(page).to have_content(milestone.title)
@@ -32,7 +32,7 @@ feature 'Admin budget investment milestones' do
end
scenario 'Displaying no_milestones text' do
- visit admin_budget_budget_investment_path(@investment.budget, @investment)
+ visit admin_budget_budget_investment_path(investment.budget, investment)
expect(page).to have_content("Milestone")
expect(page).to have_content("Don't have defined milestones")
@@ -41,14 +41,14 @@ feature 'Admin budget investment milestones' do
context "New" do
scenario "Add milestone" do
- status = create(:budget_investment_status)
- visit admin_budget_budget_investment_path(@investment.budget, @investment)
+ status = create(:milestone_status)
+ visit admin_budget_budget_investment_path(investment.budget, investment)
click_link 'Create new milestone'
- select status.name, from: 'budget_investment_milestone_status_id'
+ select status.name, from: 'milestone_status_id'
fill_in 'Description', with: 'New description milestone'
- fill_in 'budget_investment_milestone_publication_date', with: Date.current
+ fill_in 'milestone_publication_date', with: Date.current
click_button 'Create milestone'
@@ -58,14 +58,14 @@ feature 'Admin budget investment milestones' do
end
scenario "Status select is disabled if there are no statuses available" do
- visit admin_budget_budget_investment_path(@investment.budget, @investment)
+ visit admin_budget_budget_investment_path(investment.budget, investment)
click_link 'Create new milestone'
- expect(find("#budget_investment_milestone_status_id").disabled?).to be true
+ expect(find("#milestone_status_id").disabled?).to be true
end
scenario "Show validation errors on milestone form" do
- visit admin_budget_budget_investment_path(@investment.budget, @investment)
+ visit admin_budget_budget_investment_path(investment.budget, investment)
click_link 'Create new milestone'
@@ -73,7 +73,7 @@ feature 'Admin budget investment milestones' do
click_button 'Create milestone'
- within "#new_budget_investment_milestone" do
+ within "#new_milestone" do
expect(page).to have_content "can't be blank", count: 1
expect(page).to have_content 'New description milestone'
end
@@ -82,11 +82,11 @@ feature 'Admin budget investment milestones' do
context "Edit" do
scenario "Change title, description and document names" do
- milestone = create(:budget_investment_milestone, investment: @investment)
+ milestone = create(:milestone, milestoneable: investment)
create(:image, imageable: milestone)
document = create(:document, documentable: milestone)
- visit admin_budget_budget_investment_path(@investment.budget, @investment)
+ visit admin_budget_budget_investment_path(investment.budget, investment)
expect(page).to have_link document.title
click_link milestone.title
@@ -94,8 +94,8 @@ feature 'Admin budget investment milestones' do
expect(page).to have_css("img[alt='#{milestone.image.title}']")
fill_in 'Description', with: 'Changed description'
- fill_in 'budget_investment_milestone_publication_date', with: Date.current
- fill_in 'budget_investment_milestone_documents_attributes_0_title', with: 'New document title'
+ fill_in 'milestone_publication_date', with: Date.current
+ fill_in 'milestone_documents_attributes_0_title', with: 'New document title'
click_button 'Update milestone'
@@ -108,9 +108,9 @@ feature 'Admin budget investment milestones' do
context "Delete" do
scenario "Remove milestone" do
- milestone = create(:budget_investment_milestone, investment: @investment, title: "Title will it remove")
+ milestone = create(:milestone, milestoneable: investment, title: "Title will it remove")
- visit admin_budget_budget_investment_path(@investment.budget, @investment)
+ visit admin_budget_budget_investment_path(investment.budget, investment)
click_link "Delete milestone"
diff --git a/spec/features/admin/budget_investment_statuses_spec.rb b/spec/features/admin/budget_investment_statuses_spec.rb
deleted file mode 100644
index 196dc2eee..000000000
--- a/spec/features/admin/budget_investment_statuses_spec.rb
+++ /dev/null
@@ -1,95 +0,0 @@
-require 'rails_helper'
-
-feature 'Admin budget investment statuses' do
-
- background do
- admin = create(:administrator)
- login_as(admin.user)
- end
-
- context "Index" do
- scenario 'Displaying only not hidden statuses' do
- status1 = create(:budget_investment_status)
- status2 = create(:budget_investment_status)
-
- status1.destroy
-
- visit admin_budget_investment_statuses_path
-
- expect(page).not_to have_content status1.name
- expect(page).not_to have_content status1.description
-
- expect(page).to have_content status2.name
- expect(page).to have_content status2.description
- end
-
- scenario 'Displaying no statuses text' do
- visit admin_budget_investment_statuses_path
-
- expect(page).to have_content("There are no investment statuses created")
- end
- end
-
- context "New" do
- scenario "Create status" do
- visit admin_budget_investment_statuses_path
-
- click_link 'Create new investment status'
-
- fill_in 'budget_investment_status_name', with: 'New status name'
- fill_in 'budget_investment_status_description', with: 'This status description'
- click_button 'Create Investment status'
-
- expect(page).to have_content 'New status name'
- expect(page).to have_content 'This status description'
- end
-
- scenario "Show validation errors in status form" do
- visit admin_budget_investment_statuses_path
-
- click_link 'Create new investment status'
-
- fill_in 'budget_investment_status_description', with: 'This status description'
- click_button 'Create Investment status'
-
- within "#new_budget_investment_status" do
- expect(page).to have_content "can't be blank", count: 1
- end
- end
- end
-
- context "Edit" do
- scenario "Change name and description" do
- status = create(:budget_investment_status)
-
- visit admin_budget_investment_statuses_path
-
- within("#budget_investment_status_#{status.id}") do
- click_link "Edit"
- end
-
- fill_in 'budget_investment_status_name', with: 'Other status name'
- fill_in 'budget_investment_status_description', with: 'Other status description'
- click_button 'Update Investment status'
-
- expect(page).to have_content 'Other status name'
- expect(page).to have_content 'Other status description'
- end
- end
-
- context "Delete" do
- scenario "Hides status" do
- status = create(:budget_investment_status)
-
- visit admin_budget_investment_statuses_path
-
- within("#budget_investment_status_#{status.id}") do
- click_link "Delete"
- end
-
- expect(page).not_to have_content status.name
- expect(page).not_to have_content status.description
- end
- end
-
-end
diff --git a/spec/features/admin/budget_investments_spec.rb b/spec/features/admin/budget_investments_spec.rb
index 67805f013..19db58704 100644
--- a/spec/features/admin/budget_investments_spec.rb
+++ b/spec/features/admin/budget_investments_spec.rb
@@ -802,7 +802,28 @@ feature 'Admin budget investments' do
end
end
- pending "Do not display valuators of an assigned group"
+ scenario "Do not display valuators of an assigned group" do
+ budget_investment = create(:budget_investment)
+
+ health_group = create(:valuator_group, name: "Health")
+ user = create(:user, username: 'Valentina', email: 'v1@valuators.org')
+ create(:valuator, user: user, valuator_group: health_group)
+
+ visit admin_budget_budget_investment_path(budget_investment.budget, budget_investment)
+ click_link 'Edit classification'
+
+ check "budget_investment_valuator_group_ids_#{health_group.id}"
+
+ click_button 'Update'
+
+ expect(page).to have_content 'Investment project updated succesfully.'
+
+ within('#assigned_valuator_groups') { expect(page).to have_content('Health') }
+ within('#assigned_valuators') do
+ expect(page).to have_content('Undefined')
+ expect(page).not_to have_content('Valentina (v1@valuators.org)')
+ end
+ end
scenario "Adds existing valuation tags", :js do
budget_investment1 = create(:budget_investment)
diff --git a/spec/features/admin/budgets_spec.rb b/spec/features/admin/budgets_spec.rb
index dbad0494d..3ab17c18f 100644
--- a/spec/features/admin/budgets_spec.rb
+++ b/spec/features/admin/budgets_spec.rb
@@ -276,6 +276,8 @@ feature 'Admin budgets' do
fill_in 'budget_heading_name', with: 'District 9 reconstruction'
fill_in 'budget_heading_price', with: '6785'
fill_in 'budget_heading_population', with: '100500'
+ fill_in 'budget_heading_latitude', with: '40.416775'
+ fill_in 'budget_heading_longitude', with: '-3.703790'
click_button 'Save heading'
end
diff --git a/spec/features/admin/proposals_spec.rb b/spec/features/admin/hidden_proposals_spec.rb
similarity index 79%
rename from spec/features/admin/proposals_spec.rb
rename to spec/features/admin/hidden_proposals_spec.rb
index 1f48fb482..3b55d98a0 100644
--- a/spec/features/admin/proposals_spec.rb
+++ b/spec/features/admin/hidden_proposals_spec.rb
@@ -1,6 +1,6 @@
require 'rails_helper'
-feature 'Admin proposals' do
+feature 'Admin hidden proposals' do
background do
admin = create(:administrator)
@@ -12,14 +12,14 @@ feature 'Admin proposals' do
admin = create(:administrator)
login_as(admin.user)
- expect{ visit admin_proposals_path }.to raise_exception(FeatureFlags::FeatureDisabled)
+ expect{ visit admin_hidden_proposals_path }.to raise_exception(FeatureFlags::FeatureDisabled)
Setting['feature.proposals'] = true
end
scenario 'List shows all relevant info' do
proposal = create(:proposal, :hidden)
- visit admin_proposals_path
+ visit admin_hidden_proposals_path
expect(page).to have_content(proposal.title)
expect(page).to have_content(proposal.summary)
@@ -31,7 +31,7 @@ feature 'Admin proposals' do
scenario 'Restore' do
proposal = create(:proposal, :hidden)
- visit admin_proposals_path
+ visit admin_hidden_proposals_path
click_link 'Restore'
@@ -43,7 +43,7 @@ feature 'Admin proposals' do
scenario 'Confirm hide' do
proposal = create(:proposal, :hidden)
- visit admin_proposals_path
+ visit admin_hidden_proposals_path
click_link 'Confirm moderation'
@@ -55,22 +55,22 @@ feature 'Admin proposals' do
end
scenario "Current filter is properly highlighted" do
- visit admin_proposals_path
+ visit admin_hidden_proposals_path
expect(page).not_to have_link('Pending')
expect(page).to have_link('All')
expect(page).to have_link('Confirmed')
- visit admin_proposals_path(filter: 'Pending')
+ visit admin_hidden_proposals_path(filter: 'Pending')
expect(page).not_to have_link('Pending')
expect(page).to have_link('All')
expect(page).to have_link('Confirmed')
- visit admin_proposals_path(filter: 'all')
+ visit admin_hidden_proposals_path(filter: 'all')
expect(page).to have_link('Pending')
expect(page).not_to have_link('All')
expect(page).to have_link('Confirmed')
- visit admin_proposals_path(filter: 'with_confirmed_hide')
+ visit admin_hidden_proposals_path(filter: 'with_confirmed_hide')
expect(page).to have_link('All')
expect(page).to have_link('Pending')
expect(page).not_to have_link('Confirmed')
@@ -80,15 +80,15 @@ feature 'Admin proposals' do
create(:proposal, :hidden, title: "Unconfirmed proposal")
create(:proposal, :hidden, :with_confirmed_hide, title: "Confirmed proposal")
- visit admin_proposals_path(filter: 'pending')
+ visit admin_hidden_proposals_path(filter: 'pending')
expect(page).to have_content('Unconfirmed proposal')
expect(page).not_to have_content('Confirmed proposal')
- visit admin_proposals_path(filter: 'all')
+ visit admin_hidden_proposals_path(filter: 'all')
expect(page).to have_content('Unconfirmed proposal')
expect(page).to have_content('Confirmed proposal')
- visit admin_proposals_path(filter: 'with_confirmed_hide')
+ visit admin_hidden_proposals_path(filter: 'with_confirmed_hide')
expect(page).not_to have_content('Unconfirmed proposal')
expect(page).to have_content('Confirmed proposal')
end
@@ -97,7 +97,7 @@ feature 'Admin proposals' do
per_page = Kaminari.config.default_per_page
(per_page + 2).times { create(:proposal, :hidden, :with_confirmed_hide) }
- visit admin_proposals_path(filter: 'with_confirmed_hide', page: 2)
+ visit admin_hidden_proposals_path(filter: 'with_confirmed_hide', page: 2)
click_on('Restore', match: :first, exact: true)
diff --git a/spec/features/admin/milestone_statuses_spec.rb b/spec/features/admin/milestone_statuses_spec.rb
new file mode 100644
index 000000000..e928ce453
--- /dev/null
+++ b/spec/features/admin/milestone_statuses_spec.rb
@@ -0,0 +1,95 @@
+require 'rails_helper'
+
+feature 'Admin milestone statuses' do
+
+ background do
+ admin = create(:administrator)
+ login_as(admin.user)
+ end
+
+ context "Index" do
+ scenario 'Displaying only not hidden statuses' do
+ status1 = create(:milestone_status)
+ status2 = create(:milestone_status)
+
+ status1.destroy
+
+ visit admin_milestone_statuses_path
+
+ expect(page).not_to have_content status1.name
+ expect(page).not_to have_content status1.description
+
+ expect(page).to have_content status2.name
+ expect(page).to have_content status2.description
+ end
+
+ scenario 'Displaying no statuses text' do
+ visit admin_milestone_statuses_path
+
+ expect(page).to have_content("There are no milestone statuses created")
+ end
+ end
+
+ context "New" do
+ scenario "Create status" do
+ visit admin_milestone_statuses_path
+
+ click_link 'Create new milestone status'
+
+ fill_in 'milestone_status_name', with: 'New status name'
+ fill_in 'milestone_status_description', with: 'This status description'
+ click_button 'Create Milestone Status'
+
+ expect(page).to have_content 'New status name'
+ expect(page).to have_content 'This status description'
+ end
+
+ scenario "Show validation errors in status form" do
+ visit admin_milestone_statuses_path
+
+ click_link 'Create new milestone status'
+
+ fill_in 'milestone_status_description', with: 'This status description'
+ click_button 'Create Milestone Status'
+
+ within "#new_milestone_status" do
+ expect(page).to have_content "can't be blank", count: 1
+ end
+ end
+ end
+
+ context "Edit" do
+ scenario "Change name and description" do
+ status = create(:milestone_status)
+
+ visit admin_milestone_statuses_path
+
+ within("#milestone_status_#{status.id}") do
+ click_link "Edit"
+ end
+
+ fill_in 'milestone_status_name', with: 'Other status name'
+ fill_in 'milestone_status_description', with: 'Other status description'
+ click_button 'Update Milestone Status'
+
+ expect(page).to have_content 'Other status name'
+ expect(page).to have_content 'Other status description'
+ end
+ end
+
+ context "Delete" do
+ scenario "Hides status" do
+ status = create(:milestone_status)
+
+ visit admin_milestone_statuses_path
+
+ within("#milestone_status_#{status.id}") do
+ click_link "Delete"
+ end
+
+ expect(page).not_to have_content status.name
+ expect(page).not_to have_content status.description
+ end
+ end
+
+end
diff --git a/spec/features/admin/poll/questions_spec.rb b/spec/features/admin/poll/questions_spec.rb
index 4374800f2..5fedcbb34 100644
--- a/spec/features/admin/poll/questions_spec.rb
+++ b/spec/features/admin/poll/questions_spec.rb
@@ -72,7 +72,16 @@ feature 'Admin poll questions' do
expect(page).to have_link(proposal.author.name, href: user_path(proposal.author))
end
- pending "Create from successul proposal show"
+ scenario "Create from successful proposal show" do
+ poll = create(:poll, name: 'Proposals')
+ proposal = create(:proposal, :successful)
+
+ visit proposal_path(proposal)
+ click_link "Create question"
+
+ expect(page).to have_current_path(new_admin_question_path, ignore_query: true)
+ expect(page).to have_field('Question', with: proposal.title)
+ end
scenario 'Update' do
question1 = create(:poll_question)
diff --git a/spec/features/budgets/executions_spec.rb b/spec/features/budgets/executions_spec.rb
index 9627cb793..226d01cfe 100644
--- a/spec/features/budgets/executions_spec.rb
+++ b/spec/features/budgets/executions_spec.rb
@@ -12,7 +12,7 @@ feature 'Executions' do
let!(:investment3) { create(:budget_investment, :incompatible, heading: heading) }
scenario 'only displays investments with milestones' do
- create(:budget_investment_milestone, investment: investment1)
+ create(:milestone, milestoneable: investment1)
visit budget_path(budget)
click_link 'See results'
@@ -28,7 +28,7 @@ feature 'Executions' do
end
scenario "Do not display headings with no winning investments for selected status" do
- create(:budget_investment_milestone, investment: investment1)
+ create(:milestone, milestoneable: investment1)
empty_group = create(:budget_group, budget: budget)
empty_heading = create(:budget_heading, group: empty_group, price: 1000)
@@ -46,7 +46,7 @@ feature 'Executions' do
end
scenario "Show message when there are no winning investments with the selected status", :js do
- create(:budget_investment_status, name: I18n.t('seeds.budgets.statuses.executed'))
+ create(:milestone_status, name: I18n.t('seeds.budgets.statuses.executed'))
visit budget_path(budget)
@@ -63,7 +63,7 @@ feature 'Executions' do
context 'Images' do
scenario 'renders milestone image if available' do
- milestone1 = create(:budget_investment_milestone, investment: investment1)
+ milestone1 = create(:milestone, milestoneable: investment1)
create(:image, imageable: milestone1)
visit budget_path(budget)
@@ -76,7 +76,7 @@ feature 'Executions' do
end
scenario 'renders investment image if no milestone image is available' do
- create(:budget_investment_milestone, investment: investment2)
+ create(:milestone, milestoneable: investment2)
create(:image, imageable: investment2)
visit budget_path(budget)
@@ -89,7 +89,7 @@ feature 'Executions' do
end
scenario 'renders default image if no milestone nor investment images are available' do
- create(:budget_investment_milestone, investment: investment4)
+ create(:milestone, milestoneable: investment4)
visit budget_path(budget)
@@ -101,17 +101,17 @@ feature 'Executions' do
end
scenario "renders last milestone's image if investment has multiple milestones with images associated" do
- milestone1 = create(:budget_investment_milestone, investment: investment1,
- publication_date: Date.yesterday)
+ milestone1 = create(:milestone, milestoneable: investment1,
+ publication_date: Date.yesterday)
- milestone2 = create(:budget_investment_milestone, investment: investment1,
- publication_date: Date.yesterday)
+ milestone2 = create(:milestone, milestoneable: investment1,
+ publication_date: Date.yesterday)
- milestone3 = create(:budget_investment_milestone, investment: investment1,
- publication_date: Date.yesterday)
+ milestone3 = create(:milestone, milestoneable: investment1,
+ publication_date: Date.yesterday)
- milestone4 = create(:budget_investment_milestone, investment: investment1,
- publication_date: Date.yesterday)
+ milestone4 = create(:milestone, milestoneable: investment1,
+ publication_date: Date.yesterday)
create(:image, imageable: milestone2, title: 'Image for first milestone with image')
create(:image, imageable: milestone3, title: 'Image for second milestone with image')
@@ -129,17 +129,17 @@ feature 'Executions' do
context 'Filters' do
- let!(:status1) { create(:budget_investment_status, name: I18n.t('seeds.budgets.statuses.studying_project')) }
- let!(:status2) { create(:budget_investment_status, name: I18n.t('seeds.budgets.statuses.bidding')) }
+ let!(:status1) { create(:milestone_status, name: "Studying the project") }
+ let!(:status2) { create(:milestone_status, name: "Bidding") }
scenario 'Filters select with counter are shown' do
- create(:budget_investment_milestone, investment: investment1,
- publication_date: Date.yesterday,
- status: status1)
+ create(:milestone, milestoneable: investment1,
+ publication_date: Date.yesterday,
+ status: status1)
- create(:budget_investment_milestone, investment: investment2,
- publication_date: Date.yesterday,
- status: status2)
+ create(:milestone, milestoneable: investment2,
+ publication_date: Date.yesterday,
+ status: status2)
visit budget_path(budget)
@@ -152,9 +152,9 @@ feature 'Executions' do
end
scenario 'by milestone status', :js do
- create(:budget_investment_milestone, investment: investment1, status: status1)
- create(:budget_investment_milestone, investment: investment2, status: status2)
- create(:budget_investment_status, name: I18n.t('seeds.budgets.statuses.executing_project'))
+ create(:milestone, milestoneable: investment1, status: status1)
+ create(:milestone, milestoneable: investment2, status: status2)
+ create(:milestone_status, name: I18n.t('seeds.budgets.statuses.executing_project'))
visit budget_path(budget)
@@ -181,13 +181,13 @@ feature 'Executions' do
end
scenario 'are based on latest milestone status', :js do
- create(:budget_investment_milestone, investment: investment1,
- publication_date: 1.month.ago,
- status: status1)
+ create(:milestone, milestoneable: investment1,
+ publication_date: 1.month.ago,
+ status: status1)
- create(:budget_investment_milestone, investment: investment1,
- publication_date: Date.yesterday,
- status: status2)
+ create(:milestone, milestoneable: investment1,
+ publication_date: Date.yesterday,
+ status: status2)
visit budget_path(budget)
click_link 'See results'
@@ -201,13 +201,13 @@ feature 'Executions' do
end
scenario 'milestones with future dates are not shown', :js do
- create(:budget_investment_milestone, investment: investment1,
- publication_date: Date.yesterday,
- status: status1)
+ create(:milestone, milestoneable: investment1,
+ publication_date: Date.yesterday,
+ status: status1)
- create(:budget_investment_milestone, investment: investment1,
- publication_date: Date.tomorrow,
- status: status2)
+ create(:milestone, milestoneable: investment1,
+ publication_date: Date.tomorrow,
+ status: status2)
visit budget_path(budget)
click_link 'See results'
@@ -226,7 +226,7 @@ feature 'Executions' do
def create_heading_with_investment_with_milestone(group:, name:)
heading = create(:budget_heading, group: group, name: name)
investment = create(:budget_investment, :winner, heading: heading)
- milestone = create(:budget_investment_milestone, investment: investment)
+ milestone = create(:milestone, milestoneable: investment)
heading
end
@@ -260,8 +260,8 @@ feature 'Executions' do
context 'No milestones' do
scenario 'Milestone not yet published' do
- status = create(:budget_investment_status)
- unpublished_milestone = create(:budget_investment_milestone, investment: investment1,
+ status = create(:milestone_status)
+ unpublished_milestone = create(:milestone, milestoneable: investment1,
status: status, publication_date: Date.tomorrow)
visit budget_executions_path(budget, status: status.id)
diff --git a/spec/features/budgets/investments_spec.rb b/spec/features/budgets/investments_spec.rb
index e918e9f52..93f2f3799 100644
--- a/spec/features/budgets/investments_spec.rb
+++ b/spec/features/budgets/investments_spec.rb
@@ -1121,13 +1121,13 @@ feature 'Budget Investments' do
scenario "Show milestones", :js do
user = create(:user)
investment = create(:budget_investment)
- create(:budget_investment_milestone, investment: investment,
- description_en: "Last milestone with a link to https://consul.dev",
- description_es: "Último hito con el link https://consul.dev",
- publication_date: Date.tomorrow)
- first_milestone = create(:budget_investment_milestone, investment: investment,
- description: "First milestone",
- publication_date: Date.yesterday)
+ create(:milestone, milestoneable: investment,
+ description_en: "Last milestone with a link to https://consul.dev",
+ description_es: "Último hito con el link https://consul.dev",
+ publication_date: Date.tomorrow)
+ first_milestone = create(:milestone, milestoneable: investment,
+ description: "First milestone",
+ publication_date: Date.yesterday)
image = create(:image, imageable: first_milestone)
document = create(:document, documentable: first_milestone)
@@ -1455,10 +1455,10 @@ feature 'Budget Investments' do
user = create(:user, :level_two)
global_group = create(:budget_group, budget: budget, name: 'Global Group')
- global_heading = create(:budget_heading, group: global_group, name: 'Global Heading')
+ global_heading = create(:budget_heading, group: global_group, name: 'Global Heading', latitude: -43.145412, longitude: 12.009423)
carabanchel_heading = create(:budget_heading, group: group, name: "Carabanchel")
- new_york_heading = create(:budget_heading, group: group, name: "New York")
+ new_york_heading = create(:budget_heading, group: group, name: "New York", latitude: -43.223412, longitude: 12.009423)
sp1 = create(:budget_investment, :selected, price: 1, heading: global_heading)
sp2 = create(:budget_investment, :selected, price: 10, heading: global_heading)
@@ -1701,4 +1701,84 @@ feature 'Budget Investments' do
expect(Flag.flagged?(user, investment)).not_to be
end
+ context 'sidebar map' do
+ scenario "Display 6 investment's markers on sidebar map", :js do
+ investment1 = create(:budget_investment, heading: heading)
+ investment2 = create(:budget_investment, heading: heading)
+ investment3 = create(:budget_investment, heading: heading)
+ investment4 = create(:budget_investment, heading: heading)
+ investment5 = create(:budget_investment, heading: heading)
+ investment6 = create(:budget_investment, heading: heading)
+
+ create(:map_location, longitude: 40.1231, latitude: -3.636, investment: investment1)
+ create(:map_location, longitude: 40.1232, latitude: -3.635, investment: investment2)
+ create(:map_location, longitude: 40.1233, latitude: -3.634, investment: investment3)
+ create(:map_location, longitude: 40.1234, latitude: -3.633, investment: investment4)
+ create(:map_location, longitude: 40.1235, latitude: -3.632, investment: investment5)
+ create(:map_location, longitude: 40.1236, latitude: -3.631, investment: investment6)
+
+ visit budget_investments_path(budget, heading_id: heading.id)
+
+ within ".map_location" do
+ expect(page).to have_css(".map-icon", count: 6, visible: false)
+ end
+ end
+
+ scenario "Display 2 investment's markers on sidebar map", :js do
+ investment1 = create(:budget_investment, heading: heading)
+ investment2 = create(:budget_investment, heading: heading)
+
+ create(:map_location, longitude: 40.1281, latitude: -3.656, investment: investment1)
+ create(:map_location, longitude: 40.1292, latitude: -3.665, investment: investment2)
+
+ visit budget_investments_path(budget, heading_id: heading.id)
+
+ within ".map_location" do
+ expect(page).to have_css(".map-icon", count: 2, visible: false)
+ end
+ end
+
+ scenario "Display only investment's related to the current heading", :js do
+ heading_2 = create(:budget_heading, name: "Madrid", group: group)
+
+ investment1 = create(:budget_investment, heading: heading)
+ investment2 = create(:budget_investment, heading: heading)
+ investment3 = create(:budget_investment, heading: heading)
+ investment4 = create(:budget_investment, heading: heading)
+ investment5 = create(:budget_investment, heading: heading_2)
+ investment6 = create(:budget_investment, heading: heading_2)
+
+ create(:map_location, longitude: 40.1231, latitude: -3.636, investment: investment1)
+ create(:map_location, longitude: 40.1232, latitude: -3.685, investment: investment2)
+ create(:map_location, longitude: 40.1233, latitude: -3.664, investment: investment3)
+ create(:map_location, longitude: 40.1234, latitude: -3.673, investment: investment4)
+ create(:map_location, longitude: 40.1235, latitude: -3.672, investment: investment5)
+ create(:map_location, longitude: 40.1236, latitude: -3.621, investment: investment6)
+
+ visit budget_investments_path(budget, heading_id: heading.id)
+
+ within ".map_location" do
+ expect(page).to have_css(".map-icon", count: 4, visible: false)
+ end
+ end
+
+ scenario "Do not display investment's, since they're all related to other heading", :js do
+ heading_2 = create(:budget_heading, name: "Madrid", group: group)
+
+ investment1 = create(:budget_investment, heading: heading_2)
+ investment2 = create(:budget_investment, heading: heading_2)
+ investment3 = create(:budget_investment, heading: heading_2)
+
+ create(:map_location, longitude: 40.1255, latitude: -3.644, investment: investment1)
+ create(:map_location, longitude: 40.1258, latitude: -3.637, investment: investment2)
+ create(:map_location, longitude: 40.1251, latitude: -3.649, investment: investment3)
+
+ visit budget_investments_path(budget, heading_id: heading.id)
+
+ within ".map_location" do
+ expect(page).to have_css(".map-icon", count: 0, visible: false)
+ end
+ end
+ end
+
end
diff --git a/spec/features/home_spec.rb b/spec/features/home_spec.rb
index 7f90f54c1..1d60684fd 100644
--- a/spec/features/home_spec.rb
+++ b/spec/features/home_spec.rb
@@ -112,7 +112,7 @@ feature "Home" do
end
feature 'IE alert' do
- scenario 'IE visitors are presented with an alert until they close it' do
+ scenario 'IE visitors are presented with an alert until they close it', :page_driver do
# Selenium API does not include page request/response inspection methods
# so we must use Capybara::RackTest driver to set the browser's headers
Capybara.current_session.driver.header(
@@ -133,7 +133,7 @@ feature "Home" do
expect(page.driver.request.cookies['ie_alert_closed']).to eq('true')
end
- scenario 'non-IE visitors are not bothered with IE alerts' do
+ scenario 'non-IE visitors are not bothered with IE alerts', :page_driver do
visit root_path
expect(page).not_to have_xpath(ie_alert_box_xpath, visible: false)
expect(page.driver.request.cookies['ie_alert_closed']).to be_nil
@@ -143,4 +143,23 @@ feature "Home" do
"/html/body/div[@class='wrapper ']/comment()[contains(.,'ie-callout')]"
end
end
+
+ scenario 'if there are cards, the "featured" title will render' do
+ card = create(:widget_card,
+ title: "Card text",
+ description: "Card description",
+ link_text: "Link text",
+ link_url: "consul.dev"
+ )
+
+ visit root_path
+
+ expect(page).to have_css(".title", text: "Featured")
+ end
+
+ scenario 'if there are no cards, the "featured" title will not render' do
+ visit root_path
+
+ expect(page).not_to have_css(".title", text: "Featured")
+ end
end
diff --git a/spec/features/legislation/processes_spec.rb b/spec/features/legislation/processes_spec.rb
index 870646ca1..aa0b55f6e 100644
--- a/spec/features/legislation/processes_spec.rb
+++ b/spec/features/legislation/processes_spec.rb
@@ -264,7 +264,7 @@ feature 'Legislation' do
end
context 'proposals phase' do
- scenario 'not open' do
+ scenario 'not open', :with_frozen_time do
process = create(:legislation_process, :upcoming_proposals_phase)
visit legislation_process_proposals_path(process)
diff --git a/spec/features/legislation/proposals_spec.rb b/spec/features/legislation/proposals_spec.rb
index 17a7c607e..2b005e3a3 100644
--- a/spec/features/legislation/proposals_spec.rb
+++ b/spec/features/legislation/proposals_spec.rb
@@ -20,48 +20,65 @@ feature 'Legislation Proposals' do
end
end
- scenario 'Each user as a different and consistent random proposals order', :js do
- create_list(:legislation_proposal, 10, process: process)
+ feature "Random pagination" do
+ before do
+ allow(Legislation::Proposal).to receive(:default_per_page).and_return(12)
- in_browser(:one) do
+ create_list(
+ :legislation_proposal,
+ (Legislation::Proposal.default_per_page + 2),
+ process: process
+ )
+ end
+
+ scenario "Each user has a different and consistent random proposals order", :js do
+ in_browser(:one) do
+ login_as user
+ visit legislation_process_proposals_path(process)
+ @first_user_proposals_order = legislation_proposals_order
+ end
+
+ in_browser(:two) do
+ login_as user2
+ visit legislation_process_proposals_path(process)
+ @second_user_proposals_order = legislation_proposals_order
+ end
+
+ expect(@first_user_proposals_order).not_to eq(@second_user_proposals_order)
+
+ in_browser(:one) do
+ visit legislation_process_proposals_path(process)
+ expect(legislation_proposals_order).to eq(@first_user_proposals_order)
+ end
+
+ in_browser(:two) do
+ visit legislation_process_proposals_path(process)
+ expect(legislation_proposals_order).to eq(@second_user_proposals_order)
+ end
+ end
+
+ scenario "Random order maintained with pagination", :js do
login_as user
visit legislation_process_proposals_path(process)
- @first_user_proposals_order = legislation_proposals_order
+ first_page_proposals_order = legislation_proposals_order
+
+ click_link "Next"
+
+ expect(page).to have_content "You're on page 2"
+ expect(first_page_proposals_order & legislation_proposals_order).to eq([])
+
+ click_link "Previous"
+
+ expect(page).to have_content "You're on page 1"
+ expect(legislation_proposals_order).to eq(first_page_proposals_order)
end
- in_browser(:two) do
- login_as user2
- visit legislation_process_proposals_path(process)
- @second_user_proposals_order = legislation_proposals_order
+ scenario "Does not crash when the seed is not a number" do
+ login_as user
+ visit legislation_process_proposals_path(process, random_seed: "Spoof")
+
+ expect(page).to have_content "You're on page 1"
end
-
- expect(@first_user_proposals_order).not_to eq(@second_user_proposals_order)
-
- in_browser(:one) do
- visit legislation_process_proposals_path(process)
- expect(legislation_proposals_order).to eq(@first_user_proposals_order)
- end
-
- in_browser(:two) do
- visit legislation_process_proposals_path(process)
- expect(legislation_proposals_order).to eq(@second_user_proposals_order)
- end
- end
-
- scenario 'Random order maintained with pagination', :js do
- create_list(:legislation_proposal, (Kaminari.config.default_per_page + 2), process: process)
-
- login_as user
- visit legislation_process_proposals_path(process)
- first_page_proposals_order = legislation_proposals_order
-
- click_link 'Next'
- expect(page).to have_content "You're on page 2"
-
- click_link 'Previous'
- expect(page).to have_content "You're on page 1"
-
- expect(legislation_proposals_order).to eq(first_page_proposals_order)
end
context 'Selected filter' do
diff --git a/spec/features/polls/polls_spec.rb b/spec/features/polls/polls_spec.rb
index b95bb8129..a75afb8a5 100644
--- a/spec/features/polls/polls_spec.rb
+++ b/spec/features/polls/polls_spec.rb
@@ -179,12 +179,9 @@ feature 'Polls' do
visit poll_path(poll)
- expect(page).to have_content('Han Solo')
- expect(page).to have_content('Chewbacca')
expect(page).to have_content('You must Sign in or Sign up to participate')
-
- expect(page).not_to have_link('Han Solo')
- expect(page).not_to have_link('Chewbacca')
+ expect(page).to have_link('Han Solo', href: new_user_session_path)
+ expect(page).to have_link('Chewbacca', href: new_user_session_path)
end
scenario 'Level 1 users' do
@@ -203,11 +200,8 @@ feature 'Polls' do
expect(page).to have_content('You must verify your account in order to answer')
- expect(page).to have_content('Han Solo')
- expect(page).to have_content('Chewbacca')
-
- expect(page).not_to have_link('Han Solo')
- expect(page).not_to have_link('Chewbacca')
+ expect(page).to have_link('Han Solo', href: verification_path)
+ expect(page).to have_link('Chewbacca', href: verification_path)
end
scenario 'Level 2 users in an incoming poll' do
diff --git a/spec/features/proposal_notifications_spec.rb b/spec/features/proposal_notifications_spec.rb
index c5c21d27a..f374a42c8 100644
--- a/spec/features/proposal_notifications_spec.rb
+++ b/spec/features/proposal_notifications_spec.rb
@@ -364,7 +364,48 @@ feature 'Proposal Notifications' do
visit new_proposal_notification_path(proposal_id: proposal.id)
end
- pending "group notifications for the same proposal"
+ context "Group notifications" do
+
+ background do
+ Setting[:proposal_notification_minimum_interval_in_days] = 0
+ end
+
+ after do
+ Setting[:proposal_notification_minimum_interval_in_days] = 3
+ end
+
+ scenario "for the same proposal", :js do
+ author = create(:user)
+ user = create(:user)
+
+ proposal = create(:proposal, author: author)
+
+ create(:follow, :followed_proposal, user: user, followable: proposal)
+
+ login_as author.reload
+
+ 3.times do
+ visit new_proposal_notification_path(proposal_id: proposal.id)
+
+ fill_in "Title", with: "Thank you for supporting my proposal"
+ fill_in "Message", with: "Please share it with others so we can make it happen!"
+ click_button "Send message"
+
+ expect(page).to have_content "Your message has been sent correctly."
+ end
+
+ logout
+ login_as user.reload
+ visit root_path
+
+ within("#notifications") { expect(page).to have_content :all, "You have 3 new notifications" }
+ find(".icon-notification").click
+
+ expect(page).to have_css ".notification", count: 3
+ expect(page).to have_content "There is one new notification on #{proposal.title}", count: 3
+ end
+ end
+
end
scenario "Error messages" do
diff --git a/spec/features/proposals_spec.rb b/spec/features/proposals_spec.rb
index 3d567911f..eb8b5c0de 100644
--- a/spec/features/proposals_spec.rb
+++ b/spec/features/proposals_spec.rb
@@ -18,6 +18,8 @@ feature 'Proposals' do
before do
Setting['feature.allow_images'] = true
+ Setting['feature.featured_proposals'] = true
+ Setting['featured_proposals_number'] = 3
end
after do
@@ -92,6 +94,7 @@ feature 'Proposals' do
click_link "Next", exact: false
end
+ expect(page).to have_selector('#proposals .proposal-featured', count: 3)
expect(page).to have_selector('#proposals .proposal', count: 2)
end
diff --git a/spec/features/tags/budget_investments_spec.rb b/spec/features/tags/budget_investments_spec.rb
index 8719275ef..855ad934f 100644
--- a/spec/features/tags/budget_investments_spec.rb
+++ b/spec/features/tags/budget_investments_spec.rb
@@ -5,7 +5,7 @@ feature 'Tags' do
let(:author) { create(:user, :level_two, username: 'Isabel') }
let(:budget) { create(:budget, name: "Big Budget") }
let(:group) { create(:budget_group, name: "Health", budget: budget) }
- let!(:heading) { create(:budget_heading, name: "More hospitals", group: group) }
+ let!(:heading) { create(:budget_heading, name: "More hospitals", group: group, latitude: '40.416775', longitude: '-3.703790') }
let!(:tag_medio_ambiente) { create(:tag, :category, name: 'Medio Ambiente') }
let!(:tag_economia) { create(:tag, :category, name: 'Economía') }
let(:admin) { create(:administrator).user }
diff --git a/spec/lib/tasks/communities_spec.rb b/spec/lib/tasks/communities_spec.rb
index 3a8819147..3c3d17682 100644
--- a/spec/lib/tasks/communities_spec.rb
+++ b/spec/lib/tasks/communities_spec.rb
@@ -1,15 +1,9 @@
require 'rails_helper'
-require 'rake'
describe 'Communities Rake' do
describe '#associate_community' do
- before do
- Rake.application.rake_require "tasks/communities"
- Rake::Task.define_task(:environment)
- end
-
let :run_rake_task do
Rake::Task['communities:associate_community'].reenable
Rake.application.invoke_task 'communities:associate_community'
diff --git a/spec/lib/tasks/dev_seed_spec.rb b/spec/lib/tasks/dev_seed_spec.rb
index d3e69f4b9..0bd63035e 100644
--- a/spec/lib/tasks/dev_seed_spec.rb
+++ b/spec/lib/tasks/dev_seed_spec.rb
@@ -1,7 +1,4 @@
-require 'rake'
require 'rails_helper'
-Rake::Task.define_task(:environment)
-Rake.application.rake_require('tasks/db')
describe 'rake db:dev_seed' do
let :run_rake_task do
diff --git a/spec/lib/tasks/globalize_spec.rb b/spec/lib/tasks/globalize_spec.rb
index b685bb95e..26a24dd8a 100644
--- a/spec/lib/tasks/globalize_spec.rb
+++ b/spec/lib/tasks/globalize_spec.rb
@@ -1,15 +1,9 @@
require "rails_helper"
-require "rake"
describe "Globalize tasks" do
describe "#migrate_data" do
- before do
- Rake.application.rake_require "tasks/globalize"
- Rake::Task.define_task(:environment)
- end
-
let :run_rake_task do
Rake::Task["globalize:migrate_data"].reenable
Rake.application.invoke_task "globalize:migrate_data"
@@ -151,7 +145,7 @@ describe "Globalize tasks" do
before { I18n.locale = :"pt-BR" }
let!(:milestone) do
- create(:budget_investment_milestone).tap do |milestone|
+ create(:milestone).tap do |milestone|
milestone.translations.delete_all
milestone.update_column(:title, "Português")
milestone.reload
diff --git a/spec/lib/tasks/map_location_spec.rb b/spec/lib/tasks/map_location_spec.rb
index 8ef004bda..42cae9241 100644
--- a/spec/lib/tasks/map_location_spec.rb
+++ b/spec/lib/tasks/map_location_spec.rb
@@ -1,6 +1,4 @@
-require 'rake'
require 'rails_helper'
-Rails.application.load_tasks
describe 'rake map_locations:destroy' do
before do
diff --git a/spec/lib/tasks/milestones_spec.rb b/spec/lib/tasks/milestones_spec.rb
new file mode 100644
index 000000000..f4c9dd052
--- /dev/null
+++ b/spec/lib/tasks/milestones_spec.rb
@@ -0,0 +1,147 @@
+require "rails_helper"
+
+describe "Milestones tasks" do
+ describe "#migrate" do
+ let :run_rake_task do
+ Rake::Task["milestones:migrate"].reenable
+ Rake.application.invoke_task "milestones:migrate"
+ end
+
+ let!(:investment) { create(:budget_investment) }
+
+ before do
+ ActiveRecord::Base.connection.execute(
+ "INSERT INTO budget_investment_statuses " +
+ "(name, description, hidden_at, created_at, updated_at) " +
+ "VALUES ('open', 'Good', NULL, '#{Time.current - 1.day}', '#{Time.current}');"
+ )
+
+ status_id = ActiveRecord::Base.connection.execute(
+ "SELECT MAX(id) FROM budget_investment_statuses;"
+ ).to_a.first["max"]
+
+ milestone_attributes = {
+ investment_id: investment.id,
+ title: "First",
+ description: "Interesting",
+ publication_date: Date.yesterday,
+ status_id: status_id,
+ created_at: Time.current - 1.day,
+ updated_at: Time.current
+ }
+
+ ActiveRecord::Base.connection.execute(
+ "INSERT INTO budget_investment_milestones " +
+ "(#{milestone_attributes.keys.join(", ")}) " +
+ "VALUES (#{milestone_attributes.values.map { |value| "'#{value}'"}.join(", ")})"
+ )
+ end
+
+ it "migrates statuses" do
+ run_rake_task
+
+ expect(Milestone::Status.count).to be 1
+
+ status = Milestone::Status.first
+ expect(status.name).to eq "open"
+ expect(status.description).to eq "Good"
+ expect(status.hidden_at).to be nil
+ expect(status.created_at.to_date).to eq Date.yesterday
+ expect(status.updated_at.to_date).to eq Date.current
+ end
+
+ it "migrates milestones" do
+ run_rake_task
+
+ expect(Milestone.count).to be 1
+
+ milestone = Milestone.first
+ expect(milestone.milestoneable_id).to eq investment.id
+ expect(milestone.milestoneable_type).to eq "Budget::Investment"
+ expect(milestone.title).to eq "First"
+ expect(milestone.description).to eq "Interesting"
+ expect(milestone.publication_date).to eq Date.yesterday
+ expect(milestone.status_id).to eq Milestone::Status.first.id
+ expect(milestone.created_at.to_date).to eq Date.yesterday
+ expect(milestone.updated_at.to_date).to eq Date.current
+ end
+
+ it "Updates the primary key sequence correctly" do
+ run_rake_task
+ expect { create(:milestone) }.not_to raise_exception
+ end
+
+ context "Milestone has images and documents" do
+ let(:milestone_id) do
+ ActiveRecord::Base.connection.execute(
+ "SELECT MAX(id) FROM budget_investment_milestones;"
+ ).to_a.first["max"]
+ end
+
+ let!(:image) do
+ create(:image, imageable_id: milestone_id).tap do |image|
+ image.update_column(:imageable_type, "Budget::Investment::Milestone")
+ end
+ end
+
+ let!(:document) do
+ create(:document, documentable_id: milestone_id).tap do |document|
+ document.update_column(:documentable_type, "Budget::Investment::Milestone")
+ end
+ end
+
+ it "migrates images and documents" do
+ run_rake_task
+
+ expect(Milestone.last.image).to eq image
+ expect(Milestone.last.documents).to eq [document]
+ end
+ end
+
+ context "Statuses had been deleted" do
+ before do
+ ActiveRecord::Base.connection.execute(
+ "INSERT INTO budget_investment_statuses " +
+ "(name, description, hidden_at, created_at, updated_at) " +
+ "VALUES ('deleted', 'Del', NULL, '#{Time.current - 1.day}', '#{Time.current}');"
+ )
+
+ ActiveRecord::Base.connection.execute(
+ "DELETE FROM budget_investment_statuses WHERE name='deleted'"
+ )
+
+ ActiveRecord::Base.connection.execute(
+ "INSERT INTO budget_investment_statuses " +
+ "(name, description, hidden_at, created_at, updated_at) " +
+ "VALUES ('new', 'New', NULL, '#{Time.current - 1.day}', '#{Time.current}');"
+ )
+
+ status_id = ActiveRecord::Base.connection.execute(
+ "SELECT MAX(id) FROM budget_investment_statuses;"
+ ).to_a.first["max"]
+
+ milestone_attributes = {
+ investment_id: investment.id,
+ title: "Last",
+ description: "Different",
+ publication_date: Date.yesterday,
+ status_id: status_id,
+ created_at: Time.current - 1.day,
+ updated_at: Time.current
+ }
+
+ ActiveRecord::Base.connection.execute(
+ "INSERT INTO budget_investment_milestones " +
+ "(#{milestone_attributes.keys.join(", ")}) " +
+ "VALUES (#{milestone_attributes.values.map { |value| "'#{value}'"}.join(", ")})"
+ )
+ end
+
+ it "migrates the status id correctly" do
+ run_rake_task
+
+ expect(Milestone.last.status_id).to eq Milestone::Status.last.id
+ end
+ end
+ end
+end
diff --git a/spec/lib/tasks/settings_spec.rb b/spec/lib/tasks/settings_spec.rb
index 4008cf784..22cee28e1 100644
--- a/spec/lib/tasks/settings_spec.rb
+++ b/spec/lib/tasks/settings_spec.rb
@@ -1,15 +1,9 @@
require 'rails_helper'
-require 'rake'
describe 'Settings Rake' do
describe '#per_page_code_migration' do
- before do
- Rake.application.rake_require "tasks/settings"
- Rake::Task.define_task(:environment)
- end
-
let :run_rake_task do
Rake::Task['settings:per_page_code_migration'].reenable
Rake.application.invoke_task 'settings:per_page_code_migration'
diff --git a/spec/lib/tasks/sitemap_spec.rb b/spec/lib/tasks/sitemap_spec.rb
index 01dd3f430..72f0ed461 100644
--- a/spec/lib/tasks/sitemap_spec.rb
+++ b/spec/lib/tasks/sitemap_spec.rb
@@ -1,7 +1,4 @@
-require 'rake'
require 'rails_helper'
-Rails.application.load_tasks
-Rake::Task.define_task(:environment)
feature 'rake sitemap:create' do
before do
@@ -32,7 +29,6 @@ feature 'rake sitemap:create' do
expect(sitemap).to include(faq_path)
expect(sitemap).to include(help_path)
expect(sitemap).to include(how_to_use_path)
- expect(sitemap).to include(page_path(id: 'general_terms'))
# Dynamic URLs
expect(sitemap).to include(polls_path)
diff --git a/spec/models/budget/heading_spec.rb b/spec/models/budget/heading_spec.rb
index b2a09cb55..edd96a8b8 100644
--- a/spec/models/budget/heading_spec.rb
+++ b/spec/models/budget/heading_spec.rb
@@ -44,6 +44,216 @@ describe Budget::Heading do
end
end
+ describe "save latitude" do
+ it "Doesn't allow latitude == nil" do
+ expect(build(:budget_heading, group: group, name: 'Latitude is nil', population: 12412512, latitude: nil, longitude: '12.123412')).not_to be_valid
+ end
+
+ it "Doesn't allow latitude == ''" do
+ expect(build(:budget_heading, group: group, name: 'Latitude is an empty string', population: 12412512, latitude: '', longitude: '12.123412')).not_to be_valid
+ end
+
+ it "Doesn't allow latitude < -90" do
+ heading = create(:budget_heading, group: group, name: 'Latitude is < -90')
+
+ heading.latitude = '-90.127491'
+ expect(heading).not_to be_valid
+
+ heading.latitude = '-91.723491'
+ expect(heading).not_to be_valid
+
+ heading.latitude = '-108.127412'
+ expect(heading).not_to be_valid
+
+ heading.latitude = '-1100.888491'
+ expect(heading).not_to be_valid
+ end
+
+ it "Doesn't allow latitude > 90" do
+ heading = create(:budget_heading, group: group, name: 'Latitude is > 90')
+
+ heading.latitude = '90.127491'
+ expect(heading).not_to be_valid
+
+ heading.latitude = '97.723491'
+ expect(heading).not_to be_valid
+
+ heading.latitude = '119.127412'
+ expect(heading).not_to be_valid
+
+ heading.latitude = '1200.888491'
+ expect(heading).not_to be_valid
+
+ heading.latitude = '+128.888491'
+ expect(heading).not_to be_valid
+
+ heading.latitude = '+255.888491'
+ expect(heading).not_to be_valid
+ end
+
+ it "Doesn't allow latitude length > 22" do
+ heading = create(:budget_heading, group: group, name: 'Latitude length is > 22')
+
+ heading.latitude = '10.12749112312418238128213'
+ expect(heading).not_to be_valid
+
+ heading.latitude = '7.7234941211121231231241'
+ expect(heading).not_to be_valid
+
+ heading.latitude = '9.1274124111241248688995'
+ expect(heading).not_to be_valid
+
+ heading.latitude = '+12.8884911231238684445311'
+ expect(heading).not_to be_valid
+ end
+
+ it "Allows latitude inside [-90,90] interval" do
+ heading = create(:budget_heading, group: group, name: 'Latitude is inside [-90,90] interval')
+
+ heading.latitude = '90'
+ expect(heading).to be_valid
+
+ heading.latitude = '-90'
+ expect(heading).to be_valid
+
+ heading.latitude = '-90.000'
+ expect(heading).to be_valid
+
+ heading.latitude = '-90.00000'
+ expect(heading).to be_valid
+
+ heading.latitude = '90.000'
+ expect(heading).to be_valid
+
+ heading.latitude = '90.00000'
+ expect(heading).to be_valid
+
+ heading.latitude = '-80.123451'
+ expect(heading).to be_valid
+
+ heading.latitude = '+65.888491'
+ expect(heading).to be_valid
+
+ heading.latitude = '80.144812'
+ expect(heading).to be_valid
+
+ heading.latitude = '17.417412'
+ expect(heading).to be_valid
+
+ heading.latitude = '-21.000054'
+ expect(heading).to be_valid
+
+ heading.latitude = '+80.888491'
+ expect(heading).to be_valid
+ end
+ end
+
+
+ describe "save longitude" do
+ it "Doesn't allow longitude == nil" do
+ expect(build(:budget_heading, group: group, name: 'Longitude is nil', population: 12412512, latitude: '12.123412', longitude: nil)).not_to be_valid
+ end
+
+ it "Doesn't allow longitude == ''" do
+ expect(build(:budget_heading, group: group, name: 'Longitude is an empty string', population: 12412512, latitude: '12.127412', longitude: '')).not_to be_valid
+ end
+
+ it "Doesn't allow longitude < -180" do
+ heading = create(:budget_heading, group: group, name: 'Longitude is < -180')
+
+ heading.longitude = '-180.127491'
+ expect(heading).not_to be_valid
+
+ heading.longitude = '-181.723491'
+ expect(heading).not_to be_valid
+
+ heading.longitude = '-188.127412'
+ expect(heading).not_to be_valid
+
+ heading.longitude = '-1100.888491'
+ expect(heading).not_to be_valid
+ end
+
+ it "Doesn't allow longitude > 180" do
+ heading = create(:budget_heading, group: group, name: 'Longitude is > 180')
+
+ heading.longitude = '190.127491'
+ expect(heading).not_to be_valid
+
+ heading.longitude = '197.723491'
+ expect(heading).not_to be_valid
+
+ heading.longitude = '+207.723491'
+ expect(heading).not_to be_valid
+
+ heading.longitude = '300.723491'
+ expect(heading).not_to be_valid
+
+ heading.longitude = '189.127412'
+ expect(heading).not_to be_valid
+
+ heading.longitude = '1200.888491'
+ expect(heading).not_to be_valid
+ end
+
+ it "Doesn't allow longitude length > 23" do
+ heading = create(:budget_heading, group: group, name: 'Longitude length is > 23')
+
+ heading.longitude = '50.1274911123124112312418238128213'
+ expect(heading).not_to be_valid
+
+ heading.longitude = '53.73412349178811231241'
+ expect(heading).not_to be_valid
+
+ heading.longitude = '+20.1274124124124123121435'
+ expect(heading).not_to be_valid
+
+ heading.longitude = '10.88849112312312311232123311'
+ expect(heading).not_to be_valid
+ end
+
+ it "Allows longitude inside [-180,180] interval" do
+ heading = create(:budget_heading, group: group, name: 'Longitude is inside [-180,180] interval')
+
+ heading.longitude = '180'
+ expect(heading).to be_valid
+
+ heading.longitude = '-180'
+ expect(heading).to be_valid
+
+ heading.longitude = '-180.000'
+ expect(heading).to be_valid
+
+ heading.longitude = '-180.00000'
+ expect(heading).to be_valid
+
+ heading.longitude = '180.000'
+ expect(heading).to be_valid
+
+ heading.longitude = '180.00000'
+ expect(heading).to be_valid
+
+ heading.longitude = '+75.00000'
+ expect(heading).to be_valid
+
+ heading.longitude = '+15.023321'
+ expect(heading).to be_valid
+
+ heading.longitude = '-80.123451'
+ expect(heading).to be_valid
+
+ heading.longitude = '80.144812'
+ expect(heading).to be_valid
+
+ heading.longitude = '17.417412'
+ expect(heading).to be_valid
+
+ heading.longitude = '-21.000054'
+ expect(heading).to be_valid
+ end
+ end
+
+
describe "heading" do
it "can be deleted if no budget's investments associated" do
heading1 = create(:budget_heading, group: group, name: 'name')
diff --git a/spec/models/budget/investment/status_spec.rb b/spec/models/milestone/status_spec.rb
similarity index 71%
rename from spec/models/budget/investment/status_spec.rb
rename to spec/models/milestone/status_spec.rb
index 36d472a76..7e530a995 100644
--- a/spec/models/budget/investment/status_spec.rb
+++ b/spec/models/milestone/status_spec.rb
@@ -1,9 +1,9 @@
require 'rails_helper'
-describe Budget::Investment::Status do
+describe Milestone::Status do
describe "Validations" do
- let(:status) { build(:budget_investment_status) }
+ let(:status) { build(:milestone_status) }
it "is valid" do
expect(status).to be_valid
diff --git a/spec/models/budget/investment/milestone_spec.rb b/spec/models/milestone_spec.rb
similarity index 77%
rename from spec/models/budget/investment/milestone_spec.rb
rename to spec/models/milestone_spec.rb
index 45d4e7c0b..35f175aea 100644
--- a/spec/models/budget/investment/milestone_spec.rb
+++ b/spec/models/milestone_spec.rb
@@ -1,9 +1,9 @@
require 'rails_helper'
-describe Budget::Investment::Milestone do
+describe Milestone do
describe "Validations" do
- let(:milestone) { build(:budget_investment_milestone) }
+ let(:milestone) { build(:milestone) }
it "is valid" do
expect(milestone).to be_valid
@@ -25,8 +25,8 @@ describe Budget::Investment::Milestone do
expect(milestone).to be_valid
end
- it "is not valid without an investment" do
- milestone.investment_id = nil
+ it "is not valid without a milestoneable" do
+ milestone.milestoneable_id = nil
expect(milestone).not_to be_valid
end
@@ -48,7 +48,7 @@ describe Budget::Investment::Milestone do
end
describe "#description_or_status_present?" do
- let(:milestone) { build(:budget_investment_milestone) }
+ let(:milestone) { build(:milestone) }
it "is not valid when status is removed and there's no description" do
milestone.update(description: nil)
@@ -71,14 +71,14 @@ describe Budget::Investment::Milestone do
describe ".published" do
it "uses the application's time zone date", :with_different_time_zone do
- published_in_local_time_zone = create(:budget_investment_milestone,
+ published_in_local_time_zone = create(:milestone,
publication_date: Date.today)
- published_in_application_time_zone = create(:budget_investment_milestone,
+ published_in_application_time_zone = create(:milestone,
publication_date: Date.current)
- expect(Budget::Investment::Milestone.published).to include(published_in_application_time_zone)
- expect(Budget::Investment::Milestone.published).not_to include(published_in_local_time_zone)
+ expect(Milestone.published).to include(published_in_application_time_zone)
+ expect(Milestone.published).not_to include(published_in_local_time_zone)
end
end
end
diff --git a/spec/models/poll/poll_spec.rb b/spec/models/poll/poll_spec.rb
index d9ebaa4cd..f3c114155 100644
--- a/spec/models/poll/poll_spec.rb
+++ b/spec/models/poll/poll_spec.rb
@@ -175,6 +175,24 @@ describe Poll do
end
end
+ describe "#voted_by?" do
+ it "return false if the user has not voted for this poll" do
+ user = create(:user, :level_two)
+ poll = create(:poll)
+
+ expect(poll.voted_by?(user)).to eq(false)
+ end
+
+ it "returns true if the user has voted for this poll" do
+ user = create(:user, :level_two)
+ poll = create(:poll)
+
+ voter = create(:poll_voter, user: user, poll: poll)
+
+ expect(poll.voted_by?(user)).to eq(true)
+ end
+ end
+
describe "#voted_in_booth?" do
it "returns true if the user has already voted in booth" do
diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb
index 1385490c8..c3772d5d8 100644
--- a/spec/rails_helper.rb
+++ b/spec/rails_helper.rb
@@ -12,6 +12,7 @@ require 'capybara/rails'
require 'capybara/rspec'
require 'selenium/webdriver'
+Rails.application.load_tasks if Rake::Task.tasks.empty?
I18n.default_locale = :en
include Warden::Test::Helpers
diff --git a/spec/sessions_helper.rb b/spec/sessions_helper.rb
index fc3fcc2f0..13c9504d0 100644
--- a/spec/sessions_helper.rb
+++ b/spec/sessions_helper.rb
@@ -1,8 +1,3 @@
-def in_browser(name)
- old_session = Capybara.session_name
-
- Capybara.session_name = name
- yield
-
- Capybara.session_name = old_session
+def in_browser(name, &block)
+ Capybara.using_session(name, &block)
end
diff --git a/spec/shared/features/translatable.rb b/spec/shared/features/translatable.rb
index bd485334a..4994ab1d5 100644
--- a/spec/shared/features/translatable.rb
+++ b/spec/shared/features/translatable.rb
@@ -317,7 +317,7 @@ end
# even share the same colour.
def update_button_text
case translatable_class.name
- when "Budget::Investment::Milestone"
+ when "Milestone"
"Update milestone"
when "AdminNotification"
"Update notification"
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index d845190ed..c7b723b4d 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -6,7 +6,7 @@ require 'knapsack_pro'
Dir["./spec/models/concerns/*.rb"].each { |f| require f }
Dir["./spec/support/**/*.rb"].sort.each { |f| require f }
-Dir["./spec/shared/**/*.rb"].sort.each { |f| require f }
+Dir["./spec/shared/**/*.rb"].sort.each { |f| require f }
RSpec.configure do |config|
config.use_transactional_fixtures = false
@@ -19,6 +19,7 @@ RSpec.configure do |config|
config.include(EmailSpec::Matchers)
config.include(CommonActions)
config.include(ActiveSupport::Testing::TimeHelpers)
+
config.before(:suite) do
DatabaseCleaner.clean_with :truncation
end
@@ -60,8 +61,8 @@ RSpec.configure do |config|
end
end
- config.before(:each, type: :feature) do
- Capybara.reset_sessions!
+ config.after(:each, :page_driver) do
+ page.driver.reset!
end
config.before do
diff --git a/spec/support/common_actions/proposals.rb b/spec/support/common_actions/proposals.rb
index 4729a2451..93797935b 100644
--- a/spec/support/common_actions/proposals.rb
+++ b/spec/support/common_actions/proposals.rb
@@ -17,8 +17,8 @@ module Proposals
end
def create_featured_proposals
- [create(:proposal, :with_confidence_score, cached_votes_up: 100),
- create(:proposal, :with_confidence_score, cached_votes_up: 90),
- create(:proposal, :with_confidence_score, cached_votes_up: 80)]
+ [create(:proposal, :with_confidence_score, cached_votes_up: 200),
+ create(:proposal, :with_confidence_score, cached_votes_up: 100),
+ create(:proposal, :with_confidence_score, cached_votes_up: 90)]
end
end