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

@@ -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)