Make account recommendations spec more robust

We check the changes have been saved and we check recommendations have
been disabled after visiting the debates and proposals pages. The
latter helps us avoid accessing the database after the process running
the browser has been started.
This commit is contained in:
Javi Martín
2021-04-10 14:49:16 +02:00
parent 21c715bb2a
commit 559f842e68

View File

@@ -198,13 +198,18 @@ describe "Account" do
click_button "Save changes"
expect(page).to have_content "Changes saved"
expect(find("#account_recommended_debates")).not_to be_checked
expect(find("#account_recommended_proposals")).not_to be_checked
user.reload
visit debates_path
expect(user.recommended_debates).to be(false)
expect(user.recommended_proposals).to be(false)
expect(page).not_to have_link("recommendations")
visit proposals_path
expect(page).not_to have_link("recommendations")
end
end
end