Show message when request a resource to admins

This commit is contained in:
decabeza
2019-04-11 17:50:08 +02:00
parent 5b8fe4bb98
commit c76b465ce8
4 changed files with 23 additions and 3 deletions

View File

@@ -1,3 +1,9 @@
<% if dashboard_action.requested_for?(proposal) %>
<div class="callout success">
<strong><%= t("dashboard.create_request.success") %></strong>
</div>
<% end %>
<% if dashboard_action.request_to_administrators && !dashboard_action.requested_for?(proposal) %>
<%= form_for @dashboard_executed_action,
url: create_request_proposal_dashboard_action_url(proposal,

View File

@@ -482,7 +482,7 @@ en:
form:
request: Request
create_request:
success: The request for the administrator has been successfully sent.
success: The request has been successfully sent. We will contact you as soon as possible to inform you about it.
progress:
title: Graphic
group_by_month: Monthly

View File

@@ -482,7 +482,7 @@ es:
form:
request: Solicitar
create_request:
success: La petición ha sido correctamente enviada al administrador.
success: La petición ha sido correctamente enviada. Te contactaremos lo antes posible para informarte al respecto.
progress:
title: Gráfico
group_by_month: Mensual

View File

@@ -278,7 +278,8 @@ feature "Proposal's dashboard" do
click_link(feature.title)
click_button "Request"
expect(page).to have_content("The request for the administrator has been successfully sent.")
expect(page).to have_content("The request has been successfully sent. We will contact you "\
"as soon as possible to inform you about it.")
end
scenario "Request already requested resource with admin request", js: true do
@@ -293,6 +294,19 @@ feature "Proposal's dashboard" do
expect(page).to have_content("Proposal has already been taken")
end
scenario "Resource requested show message instead of button" do
feature = create(:dashboard_action, :resource, :active, :admin_request)
visit proposal_dashboard_path(proposal)
within("#side_menu") do
click_link(feature.title)
end
click_button "Request"
expect(page).to have_content("The request has been successfully sent. We will contact you "\
"as soon as possible to inform you about it.")
end
scenario "Resource without admin request do not have a request link", js: true do
feature = create(:dashboard_action, :resource, :active)