Update spec

Configure the database before starting the browser with a call to `visit`
This commit is contained in:
taitus
2023-05-24 09:21:36 +02:00
parent c52d28788a
commit 81b7f30c8a

View File

@@ -103,15 +103,20 @@ describe "Account" do
expect(find("#account_email_on_comment_reply")).to be_checked expect(find("#account_email_on_comment_reply")).to be_checked
end end
scenario "Email digest checkbox only appears if proposals are enabled" do describe "Email digest checkbox" do
visit account_path scenario "Appears when the proposals process is enabled" do
visit account_path
expect(page).to have_field "Receive a summary of proposal notifications", checked: true expect(page).to have_field "Receive a summary of proposal notifications", checked: true
end
Setting["process.proposals"] = false scenario "Does not appear when the proposals process is disabled" do
visit account_path Setting["process.proposals"] = false
expect(page).not_to have_field "Receive a summary of proposal notifications" visit account_path
expect(page).not_to have_field "Receive a summary of proposal notifications"
end
end end
context "Option to display badge for official position" do context "Option to display badge for official position" do