From 64bb42b288fab4dbbde2054cbc117217836cd835 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sat, 9 Nov 2024 01:09:54 +0100 Subject: [PATCH] Add missing expectation in hide money test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All the expectations checked after the `click_link "Check my votes"` action were already true before clicking the link, meaning the test could finish before the request did. It's possible that this request caused a test run 8274, job 2 [1], since a multitenancy test failed and a possible cause could have been simultaneous requests to both a tenant subdomain and the application's main domain. The failure was: ``` 1) Multitenancy PostgreSQL extensions work for tenants Failure/Error: expect(page).to have_content "Proposal created successfully." expected to find text "Proposal created successfully." in "Language: \n \nEnglish\nDeutsch\nEspañol\nFrançais\nNederlands\nPortuguês brasileiro\n中文\n Notifications\nMy content\nMy account\nSign out\nDebates\nYou are in\nProposals\nVoting\nCollaborative legislation\nParticipatory budgeting\nSDG\nHelp\nProposals\nCreate new proposal\nHow do citizen proposals work?\nRecommendations for creating a proposal\nDo not use capital letters for the proposal title or for whole sentences. On the internet, this is considered shouting. And nobody likes being shouted at.\nAny proposal or comment suggesting illegal action will be deleted, as well as those intending to sabotage the debate spaces. Anything else is allowed.\nEnjoy this space and the voices that fill it. It belongs to you too.\n×\n1 error prevented this Proposal from being saved.\nPlease check the marked fields to know how to correct them:\nREQUIRED FIELDS\nProposal title\nProposal summary\n(maximum 200 characters)\ntsvector for María the Martian\nProposal text\n Format\n ◢\n If you are human, ignore this field\nOPTIONAL FIELDS\nExternal video URL\nYou may add a link to YouTube or Vimeo\nDescriptive image\nYou can upload one image of following content types: jpg, up to 1 MB.\nAdd image\nDocuments\nYou can upload up to a maximum of 3 documents of following content types: pdf, up to 3 MB per file.\nAdd new document\nTags\nTag this proposal. You can choose from proposed categories or add your own\nCategories\n\nFull name of the person submitting the proposal\n(individually or as representative of a collective; will not be displayed publically)\ncan't be blank, is too short (minimum is 6 characters)\nSustainable Development Goals and Targets\nYou can choose one or several SDGs aligned with your citizen proposal\nGoals and Targets\nYou can introduce the code of a specific goal/target or a text to find one. For more information visit the SDG help page.\nI agree to the Privacy Policy and the Terms and conditions of use\nOpen government\nThis portal uses the CONSUL DEMOCRACY application which is open-source software.\nParticipation\nDecide how to shape the city you want to live in.\nCONSUL DEMOCRACY, 2024 Privacy Policy Terms and conditions of use Accessibility" ``` Note the `can't be blank, is too short` reference to the responsible name, which is only checked when user verification is not skipped. In this test, the `mars` tenant skips the verification while the default tenant does not. The mentioned possibility of simultaneous requests might have caused the issue. [1] https://github.com/consuldemocracy/consuldemocracy/actions/runs/11747689680/job/32730131655 --- spec/system/budgets/ballots_spec.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/system/budgets/ballots_spec.rb b/spec/system/budgets/ballots_spec.rb index 2d35fc40b..36bf600d0 100644 --- a/spec/system/budgets/ballots_spec.rb +++ b/spec/system/budgets/ballots_spec.rb @@ -697,6 +697,8 @@ describe "Ballots" do login_as(user) visit budget_investments_path(budget_hide_money, heading_id: heading_no_price.id) + expect(page).not_to have_content "Your ballot" + within("#sidebar") do expect(page).to have_content investment_1.title expect(page).to have_content investment_2.title @@ -706,6 +708,7 @@ describe "Ballots" do click_link "Check my votes" end + expect(page).to have_content "Your ballot" expect(page).to have_content investment_1.title expect(page).to have_content investment_2.title expect(page).not_to have_content investment_1.price