Add missing expectations in hidden content tests

We were checking that we still were on the same page, which was true
even before finishing the request to restore the content.
This commit is contained in:
Javi Martín
2025-03-30 20:20:43 +02:00
parent 4183bfced6
commit 42bfd2fce2
6 changed files with 18 additions and 0 deletions

View File

@@ -81,8 +81,11 @@ describe "Admin hidden budget investments", :admin do
visit admin_hidden_budget_investments_path(filter: "with_confirmed_hide", page: 2) visit admin_hidden_budget_investments_path(filter: "with_confirmed_hide", page: 2)
expect(page).to have_css "tbody tr", count: 2
accept_confirm { click_button "Restore", match: :first, exact: true } accept_confirm { click_button "Restore", match: :first, exact: true }
expect(page).to have_css "tbody tr", count: 1
expect(page).to have_current_path(/filter=with_confirmed_hide/) expect(page).to have_current_path(/filter=with_confirmed_hide/)
expect(page).to have_current_path(/page=2/) expect(page).to have_current_path(/page=2/)
end end

View File

@@ -130,8 +130,11 @@ describe "Admin hidden comments", :admin do
visit admin_hidden_comments_path(filter: "with_confirmed_hide", page: 2) visit admin_hidden_comments_path(filter: "with_confirmed_hide", page: 2)
expect(page).to have_css "tbody tr", count: 2
accept_confirm("Are you sure? Restore") { click_button "Restore", match: :first, exact: true } accept_confirm("Are you sure? Restore") { click_button "Restore", match: :first, exact: true }
expect(page).to have_css "tbody tr", count: 1
expect(page).to have_current_path(/filter=with_confirmed_hide/) expect(page).to have_current_path(/filter=with_confirmed_hide/)
expect(page).to have_current_path(/page=2/) expect(page).to have_current_path(/page=2/)
end end

View File

@@ -70,8 +70,11 @@ describe "Admin hidden debates", :admin do
visit admin_hidden_debates_path(filter: "with_confirmed_hide", page: 2) visit admin_hidden_debates_path(filter: "with_confirmed_hide", page: 2)
expect(page).to have_css "tbody tr", count: 2
accept_confirm("Are you sure? Restore") { click_button "Restore", match: :first, exact: true } accept_confirm("Are you sure? Restore") { click_button "Restore", match: :first, exact: true }
expect(page).to have_css "tbody tr", count: 1
expect(page).to have_current_path(/filter=with_confirmed_hide/) expect(page).to have_current_path(/filter=with_confirmed_hide/)
expect(page).to have_current_path(/page=2/) expect(page).to have_current_path(/page=2/)
end end

View File

@@ -83,8 +83,11 @@ describe "Admin hidden proposals", :admin do
visit admin_hidden_proposals_path(filter: "with_confirmed_hide", page: 2) visit admin_hidden_proposals_path(filter: "with_confirmed_hide", page: 2)
expect(page).to have_css "tbody tr", count: 2
accept_confirm("Are you sure? Restore") { click_button "Restore", match: :first, exact: true } accept_confirm("Are you sure? Restore") { click_button "Restore", match: :first, exact: true }
expect(page).to have_css "tbody tr", count: 1
expect(page).to have_current_path(/filter=with_confirmed_hide/) expect(page).to have_current_path(/filter=with_confirmed_hide/)
expect(page).to have_current_path(/page=2/) expect(page).to have_current_path(/page=2/)
end end

View File

@@ -85,10 +85,13 @@ describe "Admin hidden users", :admin do
visit admin_hidden_users_path(filter: "with_confirmed_hide", page: 2) visit admin_hidden_users_path(filter: "with_confirmed_hide", page: 2)
expect(page).to have_css "tbody tr", count: 2
accept_confirm("Are you sure? Restore \"#{users[-3].name}\"") do accept_confirm("Are you sure? Restore \"#{users[-3].name}\"") do
click_button "Restore", match: :first, exact: true click_button "Restore", match: :first, exact: true
end end
expect(page).to have_css "tbody tr", count: 1
expect(page).to have_current_path(/filter=with_confirmed_hide/) expect(page).to have_current_path(/filter=with_confirmed_hide/)
expect(page).to have_current_path(/page=2/) expect(page).to have_current_path(/page=2/)
end end

View File

@@ -80,8 +80,11 @@ describe "Admin proposal notifications", :admin do
visit admin_hidden_proposal_notifications_path(filter: "with_confirmed_hide", page: 2) visit admin_hidden_proposal_notifications_path(filter: "with_confirmed_hide", page: 2)
expect(page).to have_css "tbody tr", count: 2
accept_confirm("Are you sure? Restore") { click_button "Restore", match: :first, exact: true } accept_confirm("Are you sure? Restore") { click_button "Restore", match: :first, exact: true }
expect(page).to have_css "tbody tr", count: 1
expect(page).to have_current_path(/filter=with_confirmed_hide/) expect(page).to have_current_path(/filter=with_confirmed_hide/)
expect(page).to have_current_path(/page=2/) expect(page).to have_current_path(/page=2/)
end end