Use a button to delete surveys
As mentioned in commit 5311daadf, there are several reasons to use
buttons in these situations. And, as mentioned in the previous commits,
using buttons instead of links for actions requiring confirmation will
help us test for accessibility issues.
This commit is contained in:
@@ -442,6 +442,14 @@
|
||||
.button {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
button {
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.community-poll {
|
||||
|
||||
@@ -27,10 +27,10 @@
|
||||
<% end %>
|
||||
<p class="help-text"><%= t("dashboard.polls.poll.show_results_help") %></p>
|
||||
|
||||
<%= link_to t("dashboard.polls.poll.delete"),
|
||||
proposal_dashboard_poll_path(proposal, poll),
|
||||
method: :delete,
|
||||
"data-confirm": t("dashboard.polls.poll.alert_notice"),
|
||||
class: "delete" %>
|
||||
<%= button_to t("dashboard.polls.poll.delete"),
|
||||
proposal_dashboard_poll_path(proposal, poll),
|
||||
method: :delete,
|
||||
"data-confirm": t("dashboard.polls.poll.alert_notice"),
|
||||
class: "delete" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -199,7 +199,7 @@ describe "Polls" do
|
||||
visit proposal_dashboard_polls_path(proposal)
|
||||
|
||||
within("#poll_#{poll.id}") do
|
||||
accept_confirm { click_link "Delete survey" }
|
||||
accept_confirm { click_button "Delete survey" }
|
||||
end
|
||||
|
||||
expect(page).to have_content("Survey deleted successfully")
|
||||
@@ -214,7 +214,7 @@ describe "Polls" do
|
||||
visit proposal_dashboard_polls_path(proposal)
|
||||
|
||||
within("#poll_#{poll.id}") do
|
||||
accept_confirm { click_link "Delete survey" }
|
||||
accept_confirm { click_button "Delete survey" }
|
||||
end
|
||||
|
||||
expect(page).to have_content("You cannot destroy a survey that has responses")
|
||||
|
||||
Reference in New Issue
Block a user