diff --git a/app/components/admin/proposals/toggle_selection_component.html.erb b/app/components/admin/proposals/toggle_selection_component.html.erb index 99bf73538..e9e6cb5d5 100644 --- a/app/components/admin/proposals/toggle_selection_component.html.erb +++ b/app/components/admin/proposals/toggle_selection_component.html.erb @@ -1 +1 @@ -<%= link_to text, path, options %> +<%= button_to text, path, options %> diff --git a/spec/system/admin/legislation/proposals_spec.rb b/spec/system/admin/legislation/proposals_spec.rb index 8653594f2..5ad426356 100644 --- a/spec/system/admin/legislation/proposals_spec.rb +++ b/spec/system/admin/legislation/proposals_spec.rb @@ -19,7 +19,7 @@ describe "Admin collaborative legislation", :admin do proposal = create(:legislation_proposal, cached_votes_score: 10) visit admin_legislation_process_proposals_path(proposal.legislation_process_id) - click_link "Select" + click_button "Select" within "#legislation_proposal_#{proposal.id}" do expect(page).to have_content("Selected") diff --git a/spec/system/admin/proposals_spec.rb b/spec/system/admin/proposals_spec.rb index 473470c67..fe062220f 100644 --- a/spec/system/admin/proposals_spec.rb +++ b/spec/system/admin/proposals_spec.rb @@ -26,13 +26,13 @@ describe "Admin proposals", :admin do visit admin_proposals_path - within("#proposal_#{proposal.id}") { click_link "Select" } + within("#proposal_#{proposal.id}") { click_button "Select" } - within("#proposal_#{proposal.id}") { expect(page).to have_link "Selected" } + within("#proposal_#{proposal.id}") { expect(page).to have_button "Selected" } refresh - within("#proposal_#{proposal.id}") { expect(page).to have_link "Selected" } + within("#proposal_#{proposal.id}") { expect(page).to have_button "Selected" } end scenario "Unselect a proposal" do @@ -40,13 +40,13 @@ describe "Admin proposals", :admin do visit admin_proposals_path - within("#proposal_#{proposal.id}") { click_link "Selected" } + within("#proposal_#{proposal.id}") { click_button "Selected" } - within("#proposal_#{proposal.id}") { expect(page).to have_link "Select" } + within("#proposal_#{proposal.id}") { expect(page).to have_button "Select" } refresh - within("#proposal_#{proposal.id}") { expect(page).to have_link "Select" } + within("#proposal_#{proposal.id}") { expect(page).to have_button "Select" } end end