Show message when request a resource to admins
This commit is contained in:
@@ -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) %>
|
<% if dashboard_action.request_to_administrators && !dashboard_action.requested_for?(proposal) %>
|
||||||
<%= form_for @dashboard_executed_action,
|
<%= form_for @dashboard_executed_action,
|
||||||
url: create_request_proposal_dashboard_action_url(proposal,
|
url: create_request_proposal_dashboard_action_url(proposal,
|
||||||
|
|||||||
@@ -482,7 +482,7 @@ en:
|
|||||||
form:
|
form:
|
||||||
request: Request
|
request: Request
|
||||||
create_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:
|
progress:
|
||||||
title: Graphic
|
title: Graphic
|
||||||
group_by_month: Monthly
|
group_by_month: Monthly
|
||||||
|
|||||||
@@ -482,7 +482,7 @@ es:
|
|||||||
form:
|
form:
|
||||||
request: Solicitar
|
request: Solicitar
|
||||||
create_request:
|
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:
|
progress:
|
||||||
title: Gráfico
|
title: Gráfico
|
||||||
group_by_month: Mensual
|
group_by_month: Mensual
|
||||||
|
|||||||
@@ -278,7 +278,8 @@ feature "Proposal's dashboard" do
|
|||||||
click_link(feature.title)
|
click_link(feature.title)
|
||||||
|
|
||||||
click_button "Request"
|
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
|
end
|
||||||
|
|
||||||
scenario "Request already requested resource with admin request", js: true do
|
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")
|
expect(page).to have_content("Proposal has already been taken")
|
||||||
end
|
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
|
scenario "Resource without admin request do not have a request link", js: true do
|
||||||
feature = create(:dashboard_action, :resource, :active)
|
feature = create(:dashboard_action, :resource, :active)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user