diff --git a/config/locales/en/general.yml b/config/locales/en/general.yml
index 6b9846564..8fa3e0b2e 100644
--- a/config/locales/en/general.yml
+++ b/config/locales/en/general.yml
@@ -51,6 +51,14 @@ en:
one: 1 response
other: "%{count} responses"
zero: No responses
+ responses_show:
+ one: "1 response (show)"
+ other: "%{count} responses (show)"
+ zero: No responses
+ responses_collapse:
+ one: "1 response (collapse)"
+ other: "%{count} responses (collapse)"
+ zero: No responses
user_deleted: User deleted
votes:
one: 1 vote
@@ -478,6 +486,7 @@ en:
mailing: E-mail
poster: Poster
recommended_actions: Recommended actions
+ messages: Message to users
form:
request: Request
create_request:
@@ -539,6 +548,9 @@ en:
debates: Debates
comments: Comments
latest_comments: Latest messages
+ messages:
+ send_notification: Send message to proposal supporters
+ previous_notifications: See previous notifications
polls:
index:
title: Polls
@@ -959,8 +971,6 @@ en:
url_placeholder: Link address
communities:
show:
- send_notification: Send message to the community
- author: Author
surveys: Surveys
complete_survey: Complete the survey
subnav:
diff --git a/config/locales/en/legislation.yml b/config/locales/en/legislation.yml
index ab83e4b0d..8d24194ae 100644
--- a/config/locales/en/legislation.yml
+++ b/config/locales/en/legislation.yml
@@ -123,3 +123,4 @@ en:
form:
tags_label: "Categories"
not_verified: "For vote proposals %{verify_account}."
+ process_title: Collaborative legislation process
diff --git a/config/locales/en/settings.yml b/config/locales/en/settings.yml
index a1460204e..cb0363f48 100644
--- a/config/locales/en/settings.yml
+++ b/config/locales/en/settings.yml
@@ -70,11 +70,11 @@ en:
poll_link: Additional information link
poll_link_description: Añade un enlace de información adicional a la funcionalidad de encuestas del panel de control
email_short_title: Email
- email_short_title_description: Short description of the email feature. Allows users to send an email to promote their proposal
+ email_short_title_description: 'Short description of the email feature. Allows users to send an email to promote their proposal. You can find all the content of this email in "/app/views/dashboard/mailer/forward.html.erb"'
email_description: Email description
email_description_description: Detailed description of the email feature
poster_short_title: Poster
- poster_short_title_description: Short description of the poster feature. Allows users to download a poster on PDF format to promote their proposal
+ poster_short_title_description: 'Short description of the poster feature. Allows users to download a poster on PDF format to promote their proposal. You can find all the content of this poster in "/app/views/dashboard/poster/index.pdf.erb"'
poster_description: Poster description
poster_description_description: Detailed description of the poster feature
analytics_url: "Analytics URL"
@@ -132,7 +132,7 @@ en:
polls_description: "Citizens' polls are a participatory mechanism by which citizens with voting rights can make direct decisions"
budgets: "Participatory budgeting"
budgets_description: "With participatory budgets, citizens decide which projects presented by their neighbours will receive a part of the budget"
- legislation: "Legislation"
+ legislation: "Collaborative Legislation"
legislation_description: "In participatory processes, citizens are offered the opportunity to participate in the drafting and modification of regulations that affect the society and to give their opinion on certain actions that are planned to be carried out"
html:
per_page_code_head: "Code to be included on every page ()"
diff --git a/config/locales/es/general.yml b/config/locales/es/general.yml
index 1a3746c31..a15374549 100644
--- a/config/locales/es/general.yml
+++ b/config/locales/es/general.yml
@@ -49,8 +49,16 @@ es:
moderator: Moderador
responses:
zero: Sin respuestas
- one: 1 Respuesta
- other: "%{count} Respuestas"
+ one: 1 respuesta
+ other: "%{count} respuestas"
+ responses_show:
+ one: "1 respuesta (mostrar)"
+ other: "%{count} respuestas (mostrar)"
+ zero: Sin respuestas
+ responses_collapse:
+ one: "1 respuesta (colapsar)"
+ other: "%{count} respuestas (colapsar)"
+ zero: Sin respuestas
user_deleted: Usuario eliminado
votes:
zero: Sin votos
@@ -478,6 +486,7 @@ es:
mailing: Correo electrónico
poster: Póster
recommended_actions: Acciones recomendadas
+ messages: Mensajes a usuarios
form:
request: Solicitar
create_request:
@@ -539,6 +548,9 @@ es:
debates: Debates
comments: Comentarios
latest_comments: Últimos mensajes
+ messages:
+ send_notification: Enviar mensaje a los que han apoyado la propuesta
+ previous_notifications: Ver notificaciones anteriores
polls:
index:
title: Encuestas
@@ -957,8 +969,6 @@ es:
url_placeholder: Dirección del enlace
communities:
show:
- send_notification: Enviar mensaje a la Comunidad
- author: Autor
surveys: Encuestas
complete_survey: Completa la encuesta
subnav:
diff --git a/config/locales/es/legislation.yml b/config/locales/es/legislation.yml
index 797f5d26b..6d45afca8 100644
--- a/config/locales/es/legislation.yml
+++ b/config/locales/es/legislation.yml
@@ -123,3 +123,4 @@ es:
form:
tags_label: "Categorías"
not_verified: "Para votar propuestas %{verify_account}."
+ process_title: Proceso de legislación colaborativa
diff --git a/config/locales/es/settings.yml b/config/locales/es/settings.yml
index 06f60e8d0..42b0726d1 100644
--- a/config/locales/es/settings.yml
+++ b/config/locales/es/settings.yml
@@ -70,11 +70,11 @@ es:
poll_link: Enlace de información adicional
poll_link_description: Añade un enlace de información adicional a la funcionalidad de encuestas del panel de control
email_short_title: Correo electrónico
- email_short_title_description: Breve descripción de la funcionalidad de correo electrónico. Permite a los usuarios enviar un email para difundir su propuesta
+ email_short_title_description: 'Breve descripción de la funcionalidad de correo electrónico. Permite a los usuarios enviar un email para difundir su propuesta. Puedes encontrar todo el contenido de este correo electrónico en "/app/views/dashboard/mailer/forward.html.erb"'
email_description: Descripción correo electrónico
email_description_description: Descripción detallada de la funcionalidad de correo electrónico
poster_short_title: Póster
- poster_short_title_description: Breve descripción de la funcionalidad de póster. Permite a los usuarios descargar un póster en formato PDF para difundir su propuesta
+ poster_short_title_description: 'Breve descripción de la funcionalidad de póster. Permite a los usuarios descargar un póster en formato PDF para difundir su propuesta. Puedes encontrar todo el contenido de este póster en "/app/views/dashboard/poster/index.pdf.erb"'
poster_description: Descripción póster
poster_description_description: Descripción detallada de la funcionalidad de póster
analytics_url: "URL de estadísticas externas"
@@ -132,7 +132,7 @@ es:
polls_description: "Las votaciones ciudadanas son un mecanismo de participación por el que la ciudadanía con derecho a voto puede tomar decisiones de forma directa"
budgets: "Presupuestos participativos"
budgets_description: "Con los presupuestos participativos la ciudadanía decide a qué proyectos presentados por los vecinos y vecinas va destinada una parte del presupuesto"
- legislation: "Legislación"
+ legislation: "Legislación colaborativa"
legislation_description: "En los procesos participativos se ofrece a la ciudadanía la oportunidad de participar en la elaboración y modificación de normativa que afecta a la sociedad y de dar su opinión sobre ciertas actuaciones que se tiene previsto llevar a cabo"
html:
per_page_code_head: "Código a incluir en cada página ()"
diff --git a/config/routes/proposal.rb b/config/routes/proposal.rb
index 6ead4dff3..131c1f402 100644
--- a/config/routes/proposal.rb
+++ b/config/routes/proposal.rb
@@ -5,6 +5,7 @@ resources :proposals do
get :progress
get :community
get :recommended_actions
+ get :messages
end
resources :resources, only: [:index], controller: "dashboard/resources"
diff --git a/spec/features/comments/budget_investments_spec.rb b/spec/features/comments/budget_investments_spec.rb
index 58a468755..b5f064d93 100644
--- a/spec/features/comments/budget_investments_spec.rb
+++ b/spec/features/comments/budget_investments_spec.rb
@@ -44,6 +44,21 @@ describe "Commenting Budget::Investments" do
expect(page).to have_selector("ul#comment_#{second_child.id}>li", count: 1)
end
+ scenario "Link to comment show" do
+ comment = create(:comment, commentable: investment, user: user)
+
+ visit budget_investment_path(investment.budget, investment)
+
+ within "#comment_#{comment.id}" do
+ expect(page).to have_link comment.created_at.strftime("%Y-%m-%d %T")
+ end
+
+ click_link comment.created_at.strftime("%Y-%m-%d %T")
+
+ expect(page).to have_link "Go back to #{investment.title}"
+ expect(page).to have_current_path(comment_path(comment))
+ end
+
scenario "Collapsable comments", :js do
parent_comment = create(:comment, body: "Main comment", commentable: investment)
child_comment = create(:comment, body: "First subcomment", commentable: investment, parent: parent_comment)
@@ -52,20 +67,25 @@ describe "Commenting Budget::Investments" do
visit budget_investment_path(investment.budget, investment)
expect(page).to have_css(".comment", count: 3)
+ expect(page).to have_content("1 response (collapse)", count: 2)
find("#comment_#{child_comment.id}_children_arrow").click
expect(page).to have_css(".comment", count: 2)
+ expect(page).to have_content("1 response (collapse)")
+ expect(page).to have_content("1 response (show)")
expect(page).not_to have_content grandchild_comment.body
find("#comment_#{child_comment.id}_children_arrow").click
expect(page).to have_css(".comment", count: 3)
+ expect(page).to have_content("1 response (collapse)", count: 2)
expect(page).to have_content grandchild_comment.body
find("#comment_#{parent_comment.id}_children_arrow").click
expect(page).to have_css(".comment", count: 1)
+ expect(page).to have_content("1 response (show)")
expect(page).not_to have_content child_comment.body
expect(page).not_to have_content grandchild_comment.body
end
diff --git a/spec/features/comments/budget_investments_valuation_spec.rb b/spec/features/comments/budget_investments_valuation_spec.rb
index 4099b6524..1acb5819c 100644
--- a/spec/features/comments/budget_investments_valuation_spec.rb
+++ b/spec/features/comments/budget_investments_valuation_spec.rb
@@ -74,20 +74,25 @@ describe "Internal valuation comments on Budget::Investments" do
visit valuation_budget_budget_investment_path(budget, investment)
expect(page).to have_css(".comment", count: 3)
+ expect(page).to have_content("1 response (collapse)", count: 2)
find("#comment_#{child_comment.id}_children_arrow").click
expect(page).to have_css(".comment", count: 2)
+ expect(page).to have_content("1 response (collapse)")
+ expect(page).to have_content("1 response (show)")
expect(page).not_to have_content grandchild_comment.body
find("#comment_#{child_comment.id}_children_arrow").click
expect(page).to have_css(".comment", count: 3)
+ expect(page).to have_content("1 response (collapse)", count: 2)
expect(page).to have_content grandchild_comment.body
find("#comment_#{parent_comment.id}_children_arrow").click
expect(page).to have_css(".comment", count: 1)
+ expect(page).to have_content("1 response (show)")
expect(page).not_to have_content child_comment.body
expect(page).not_to have_content grandchild_comment.body
end
diff --git a/spec/features/comments/debates_spec.rb b/spec/features/comments/debates_spec.rb
index c8e17f170..9e9734f0b 100644
--- a/spec/features/comments/debates_spec.rb
+++ b/spec/features/comments/debates_spec.rb
@@ -39,6 +39,21 @@ describe "Commenting debates" do
expect(page).to have_selector("ul#comment_#{second_child.id}>li", count: 1)
end
+ scenario "Link to comment show" do
+ comment = create(:comment, commentable: debate, user: user)
+
+ visit debate_path(debate)
+
+ within "#comment_#{comment.id}" do
+ expect(page).to have_link comment.created_at.strftime("%Y-%m-%d %T")
+ end
+
+ click_link comment.created_at.strftime("%Y-%m-%d %T")
+
+ expect(page).to have_link "Go back to #{debate.title}"
+ expect(page).to have_current_path(comment_path(comment))
+ end
+
scenario "Collapsable comments", :js do
parent_comment = create(:comment, body: "Main comment", commentable: debate)
child_comment = create(:comment, body: "First subcomment", commentable: debate, parent: parent_comment)
@@ -47,20 +62,25 @@ describe "Commenting debates" do
visit debate_path(debate)
expect(page).to have_css(".comment", count: 3)
+ expect(page).to have_content("1 response (collapse)", count: 2)
find("#comment_#{child_comment.id}_children_arrow").click
expect(page).to have_css(".comment", count: 2)
+ expect(page).to have_content("1 response (collapse)")
+ expect(page).to have_content("1 response (show)")
expect(page).not_to have_content grandchild_comment.body
find("#comment_#{child_comment.id}_children_arrow").click
expect(page).to have_css(".comment", count: 3)
+ expect(page).to have_content("1 response (collapse)", count: 2)
expect(page).to have_content grandchild_comment.body
find("#comment_#{parent_comment.id}_children_arrow").click
expect(page).to have_css(".comment", count: 1)
+ expect(page).to have_content("1 response (show)")
expect(page).not_to have_content child_comment.body
expect(page).not_to have_content grandchild_comment.body
end
diff --git a/spec/features/comments/legislation_annotations_spec.rb b/spec/features/comments/legislation_annotations_spec.rb
index 5b608058a..1b3da8211 100644
--- a/spec/features/comments/legislation_annotations_spec.rb
+++ b/spec/features/comments/legislation_annotations_spec.rb
@@ -44,6 +44,22 @@ describe "Commenting legislation questions" do
expect(page).to have_selector("ul#comment_#{second_child.id}>li", count: 1)
end
+ scenario "Link to comment show" do
+ comment = create(:comment, commentable: legislation_annotation, user: user)
+
+ visit legislation_process_draft_version_annotation_path(legislation_annotation.draft_version.process,
+ legislation_annotation.draft_version,
+ legislation_annotation)
+
+ within "#comment_#{comment.id}" do
+ expect(page).to have_link comment.created_at.strftime("%Y-%m-%d %T")
+ click_link comment.created_at.strftime("%Y-%m-%d %T")
+ end
+
+ expect(page).to have_link "Go back to #{legislation_annotation.title}"
+ expect(page).to have_current_path(comment_path(comment))
+ end
+
scenario "Collapsable comments", :js do
parent_comment = legislation_annotation.comments.first
child_comment = create(:comment, body: "First subcomment", commentable: legislation_annotation, parent: parent_comment)
@@ -54,20 +70,25 @@ describe "Commenting legislation questions" do
legislation_annotation)
expect(page).to have_css(".comment", count: 3)
+ expect(page).to have_content("1 response (collapse)", count: 2)
find("#comment_#{child_comment.id}_children_arrow").click
expect(page).to have_css(".comment", count: 2)
+ expect(page).to have_content("1 response (collapse)")
+ expect(page).to have_content("1 response (show)")
expect(page).not_to have_content grandchild_comment.body
find("#comment_#{child_comment.id}_children_arrow").click
expect(page).to have_css(".comment", count: 3)
+ expect(page).to have_content("1 response (collapse)", count: 2)
expect(page).to have_content grandchild_comment.body
find("#comment_#{parent_comment.id}_children_arrow").click
expect(page).to have_css(".comment", count: 1)
+ expect(page).to have_content("1 response (show)")
expect(page).not_to have_content child_comment.body
expect(page).not_to have_content grandchild_comment.body
end
diff --git a/spec/features/comments/legislation_questions_spec.rb b/spec/features/comments/legislation_questions_spec.rb
index 67be1f55d..ecd1a0988 100644
--- a/spec/features/comments/legislation_questions_spec.rb
+++ b/spec/features/comments/legislation_questions_spec.rb
@@ -46,6 +46,21 @@ describe "Commenting legislation questions" do
expect(page).to have_selector("ul#comment_#{second_child.id}>li", count: 1)
end
+ scenario "Link to comment show" do
+ comment = create(:comment, commentable: legislation_question, user: user)
+
+ visit legislation_process_question_path(legislation_question.process, legislation_question)
+
+ within "#comment_#{comment.id}" do
+ expect(page).to have_link comment.created_at.strftime("%Y-%m-%d %T")
+ end
+
+ click_link comment.created_at.strftime("%Y-%m-%d %T")
+
+ expect(page).to have_link "Go back to #{legislation_question.title}"
+ expect(page).to have_current_path(comment_path(comment))
+ end
+
scenario "Collapsable comments", :js do
parent_comment = create(:comment, body: "Main comment", commentable: legislation_question)
child_comment = create(:comment, body: "First subcomment", commentable: legislation_question, parent: parent_comment)
@@ -54,20 +69,25 @@ describe "Commenting legislation questions" do
visit legislation_process_question_path(legislation_question.process, legislation_question)
expect(page).to have_css(".comment", count: 3)
+ expect(page).to have_content("1 response (collapse)", count: 2)
find("#comment_#{child_comment.id}_children_arrow").click
expect(page).to have_css(".comment", count: 2)
+ expect(page).to have_content("1 response (collapse)")
+ expect(page).to have_content("1 response (show)")
expect(page).not_to have_content grandchild_comment.body
find("#comment_#{child_comment.id}_children_arrow").click
expect(page).to have_css(".comment", count: 3)
+ expect(page).to have_content("1 response (collapse)", count: 2)
expect(page).to have_content grandchild_comment.body
find("#comment_#{parent_comment.id}_children_arrow").click
expect(page).to have_css(".comment", count: 1)
+ expect(page).to have_content("1 response (show)")
expect(page).not_to have_content child_comment.body
expect(page).not_to have_content grandchild_comment.body
end
diff --git a/spec/features/comments/polls_spec.rb b/spec/features/comments/polls_spec.rb
index 1a4c20664..8a1fb1b27 100644
--- a/spec/features/comments/polls_spec.rb
+++ b/spec/features/comments/polls_spec.rb
@@ -40,6 +40,21 @@ describe "Commenting polls" do
expect(page).to have_selector("ul#comment_#{second_child.id}>li", count: 1)
end
+ scenario "Link to comment show" do
+ comment = create(:comment, commentable: poll, user: user)
+
+ visit poll_path(poll)
+
+ within "#comment_#{comment.id}" do
+ expect(page).to have_link comment.created_at.strftime("%Y-%m-%d %T")
+ end
+
+ click_link comment.created_at.strftime("%Y-%m-%d %T")
+
+ expect(page).to have_link "Go back to #{poll.title}"
+ expect(page).to have_current_path(comment_path(comment))
+ end
+
scenario "Collapsable comments", :js do
parent_comment = create(:comment, body: "Main comment", commentable: poll)
child_comment = create(:comment, body: "First subcomment", commentable: poll, parent: parent_comment)
@@ -48,20 +63,25 @@ describe "Commenting polls" do
visit poll_path(poll)
expect(page).to have_css(".comment", count: 3)
+ expect(page).to have_content("1 response (collapse)", count: 2)
find("#comment_#{child_comment.id}_children_arrow").click
expect(page).to have_css(".comment", count: 2)
+ expect(page).to have_content("1 response (collapse)")
+ expect(page).to have_content("1 response (show)")
expect(page).not_to have_content grandchild_comment.body
find("#comment_#{child_comment.id}_children_arrow").click
expect(page).to have_css(".comment", count: 3)
+ expect(page).to have_content("1 response (collapse)", count: 2)
expect(page).to have_content grandchild_comment.body
find("#comment_#{parent_comment.id}_children_arrow").click
expect(page).to have_css(".comment", count: 1)
+ expect(page).to have_content("1 response (show)")
expect(page).not_to have_content child_comment.body
expect(page).not_to have_content grandchild_comment.body
end
diff --git a/spec/features/comments/proposals_spec.rb b/spec/features/comments/proposals_spec.rb
index d86b016a9..9c0ae0cb3 100644
--- a/spec/features/comments/proposals_spec.rb
+++ b/spec/features/comments/proposals_spec.rb
@@ -38,6 +38,21 @@ describe "Commenting proposals" do
expect(page).to have_selector("ul#comment_#{second_child.id}>li", count: 1)
end
+ scenario "Link to comment show" do
+ comment = create(:comment, commentable: proposal, user: user)
+
+ visit proposal_path(proposal)
+
+ within "#comment_#{comment.id}" do
+ expect(page).to have_link comment.created_at.strftime("%Y-%m-%d %T")
+ end
+
+ click_link comment.created_at.strftime("%Y-%m-%d %T")
+
+ expect(page).to have_link "Go back to #{proposal.title}"
+ expect(page).to have_current_path(comment_path(comment))
+ end
+
scenario "Collapsable comments", :js do
parent_comment = create(:comment, body: "Main comment", commentable: proposal)
child_comment = create(:comment, body: "First subcomment", commentable: proposal, parent: parent_comment)
@@ -46,20 +61,25 @@ describe "Commenting proposals" do
visit proposal_path(proposal)
expect(page).to have_css(".comment", count: 3)
+ expect(page).to have_content("1 response (collapse)", count: 2)
find("#comment_#{child_comment.id}_children_arrow").click
expect(page).to have_css(".comment", count: 2)
+ expect(page).to have_content("1 response (collapse)")
+ expect(page).to have_content("1 response (show)")
expect(page).not_to have_content grandchild_comment.body
find("#comment_#{child_comment.id}_children_arrow").click
expect(page).to have_css(".comment", count: 3)
+ expect(page).to have_content("1 response (collapse)", count: 2)
expect(page).to have_content grandchild_comment.body
find("#comment_#{parent_comment.id}_children_arrow").click
expect(page).to have_css(".comment", count: 1)
+ expect(page).to have_content("1 response (show)")
expect(page).not_to have_content child_comment.body
expect(page).not_to have_content grandchild_comment.body
end
diff --git a/spec/features/comments/topics_spec.rb b/spec/features/comments/topics_spec.rb
index b6b918055..ff6059e3d 100644
--- a/spec/features/comments/topics_spec.rb
+++ b/spec/features/comments/topics_spec.rb
@@ -39,6 +39,23 @@ describe "Commenting topics from proposals" do
expect(page).to have_link "Go back to #{topic.title}", href: community_topic_path(community, topic)
end
+ scenario "Link to comment show" do
+ community = proposal.community
+ topic = create(:topic, community: community)
+ comment = create(:comment, commentable: topic, user: user)
+
+ visit community_topic_path(community, topic)
+
+ within "#comment_#{comment.id}" do
+ expect(page).to have_link comment.created_at.strftime("%Y-%m-%d %T")
+ end
+
+ click_link comment.created_at.strftime("%Y-%m-%d %T")
+
+ expect(page).to have_link "Go back to #{topic.title}"
+ expect(page).to have_current_path(comment_path(comment))
+ end
+
scenario "Collapsable comments", :js do
community = proposal.community
topic = create(:topic, community: community)
@@ -49,20 +66,25 @@ describe "Commenting topics from proposals" do
visit community_topic_path(community, topic)
expect(page).to have_css(".comment", count: 3)
+ expect(page).to have_content("1 response (collapse)", count: 2)
find("#comment_#{child_comment.id}_children_arrow").click
expect(page).to have_css(".comment", count: 2)
+ expect(page).to have_content("1 response (collapse)")
+ expect(page).to have_content("1 response (show)")
expect(page).not_to have_content grandchild_comment.body
find("#comment_#{child_comment.id}_children_arrow").click
expect(page).to have_css(".comment", count: 3)
+ expect(page).to have_content("1 response (collapse)", count: 2)
expect(page).to have_content grandchild_comment.body
find("#comment_#{parent_comment.id}_children_arrow").click
expect(page).to have_css(".comment", count: 1)
+ expect(page).to have_content("1 response (show)")
expect(page).not_to have_content child_comment.body
expect(page).not_to have_content grandchild_comment.body
end
diff --git a/spec/features/dashboard/dashboard_spec.rb b/spec/features/dashboard/dashboard_spec.rb
index 34fdd7e38..f7b653ebe 100644
--- a/spec/features/dashboard/dashboard_spec.rb
+++ b/spec/features/dashboard/dashboard_spec.rb
@@ -358,6 +358,37 @@ describe "Proposal's dashboard" do
expect(page).to have_content("Done")
end
+ scenario "Dashboard has a link to messages" do
+ expect(page).to have_link("Message to users")
+
+ within("#side_menu") do
+ click_link "Message to users"
+ end
+
+ expect(page).to have_link("Send message to proposal supporters")
+ expect(page).to have_link("See previous notifications")
+ end
+
+ scenario "Dashboard has a link to send message to proposal supporters" do
+ visit messages_proposal_dashboard_path(proposal)
+ click_link("Send message to proposal supporters")
+
+ fill_in "Title", with: "Thank you for supporting my proposal"
+ fill_in "Message", with: "Please share it with others!"
+ click_button "Send message"
+
+ expect(page).to have_content "Your message has been sent correctly."
+ expect(page).to have_content "Thank you for supporting my proposal"
+ expect(page).to have_content "Please share it with others!"
+ end
+
+ scenario "Dashboard has a link to see previous notifications" do
+ visit messages_proposal_dashboard_path(proposal)
+
+ expect(page).to have_link("See previous notifications", href: proposal_path(proposal,
+ anchor: "tab-notifications"))
+ end
+
scenario "On recommended actions section display from the fourth proposed actions
when click see_proposed_actions_link", js: true do
create_list(:dashboard_action, 4, :proposed_action, :active)
diff --git a/spec/features/legislation/proposals_spec.rb b/spec/features/legislation/proposals_spec.rb
index 91af4b109..76a76f4d0 100644
--- a/spec/features/legislation/proposals_spec.rb
+++ b/spec/features/legislation/proposals_spec.rb
@@ -190,4 +190,15 @@ describe "Legislation Proposals" do
visit legislation_process_proposal_path(process, legislation_proposal_negative)
expect(page).to have_content("-6 votes")
end
+
+ scenario "Show link to process on show" do
+ create(:legislation_proposal, legislation_process_id: process.id)
+
+ visit legislation_process_proposal_path(proposal.process, proposal)
+
+ within(".process-proposal") do
+ expect(page).to have_content("Collaborative legislation process")
+ expect(page).to have_link(process.title)
+ end
+ end
end
diff --git a/spec/features/proposal_notifications_spec.rb b/spec/features/proposal_notifications_spec.rb
index 6b12286f3..b277d8506 100644
--- a/spec/features/proposal_notifications_spec.rb
+++ b/spec/features/proposal_notifications_spec.rb
@@ -4,15 +4,19 @@ describe "Proposal Notifications" do
scenario "Send a notification" do
author = create(:user)
- proposal = create(:proposal, author: author)
+ create(:proposal, author: author)
login_as(author)
visit root_path
click_link "My content"
- click_link proposal.title
- click_link "Access the community"
- click_link "Send message to the community"
+ click_link "Dashboard"
+
+ within("#side_menu") do
+ click_link "Message to users"
+ end
+
+ click_link "Send message to proposal supporters"
fill_in "proposal_notification_title", with: "Thank you for supporting my proposal"
fill_in "proposal_notification_body", with: "Please share it with "\
@@ -178,9 +182,19 @@ describe "Proposal Notifications" do
proposal = create(:proposal, author: author)
login_as(author)
- visit community_path(proposal.community)
+ visit root_path
- expect(page).to have_link "Send message to the community"
+ click_link "My content"
+
+ within("#proposal_#{proposal.id}") do
+ click_link "Dashboard"
+ end
+
+ within("#side_menu") do
+ click_link "Message to users"
+ end
+
+ expect(page).to have_link "Send message to proposal supporters"
end
scenario "Accessing form directly" do
diff --git a/spec/support/common_actions/notifications.rb b/spec/support/common_actions/notifications.rb
index 2d10fab21..f014be220 100644
--- a/spec/support/common_actions/notifications.rb
+++ b/spec/support/common_actions/notifications.rb
@@ -20,11 +20,14 @@ module Notifications
click_link "My content"
within("#proposal_#{proposal.id}") do
- click_link proposal.title
+ click_link "Dashboard"
end
- click_link "Access the community"
- click_link "Send message to the community"
+ within("#side_menu") do
+ click_link "Message to users"
+ end
+
+ click_link "Send message to proposal supporters"
fill_in "proposal_notification_title", with: "Thanks for supporting proposal: #{proposal.title}"
fill_in "proposal_notification_body", with: "Please share it with others! #{proposal.summary}"