Merge pull request #5113 from consul/proposals_notifications

Show email digest only if proposals are enabled
This commit is contained in:
Senén Rodero
2023-05-23 11:35:31 +02:00
committed by GitHub
2 changed files with 16 additions and 3 deletions

View File

@@ -54,9 +54,11 @@
<%= f.check_box :newsletter %> <%= f.check_box :newsletter %>
</div> </div>
<div> <% if feature?(:proposals) %>
<%= f.check_box :email_digest %> <div>
</div> <%= f.check_box :email_digest %>
</div>
<% end %>
<div> <div>
<%= f.check_box :email_on_direct_message %> <%= f.check_box :email_on_direct_message %>

View File

@@ -103,6 +103,17 @@ 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
visit account_path
expect(page).to have_field "Receive a summary of proposal notifications", checked: true
Setting["process.proposals"] = false
visit account_path
expect(page).not_to have_field "Receive a summary of proposal notifications"
end
context "Option to display badge for official position" do context "Option to display badge for official position" do
scenario "Users with official position of level 1" do scenario "Users with official position of level 1" do
official_user = create(:user, official_level: 1) official_user = create(:user, official_level: 1)