adds option to receive email digest
This commit is contained in:
@@ -25,7 +25,7 @@ class AccountController < ApplicationController
|
|||||||
if @account.organization?
|
if @account.organization?
|
||||||
params.require(:account).permit(:phone_number, :email_on_comment, :email_on_comment_reply, :newsletter, organization_attributes: [:name, :responsible_name])
|
params.require(:account).permit(:phone_number, :email_on_comment, :email_on_comment_reply, :newsletter, organization_attributes: [:name, :responsible_name])
|
||||||
else
|
else
|
||||||
params.require(:account).permit(:username, :public_activity, :email_on_comment, :email_on_comment_reply, :email_on_proposal_notification, :newsletter)
|
params.require(:account).permit(:username, :public_activity, :email_on_comment, :email_on_comment_reply, :email_on_proposal_notification, :email_digest, :newsletter)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -78,6 +78,15 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<%= f.label :email_digest do %>
|
||||||
|
<%= f.check_box :email_digest, title: t('account.show.email_digest_label'), label: false %>
|
||||||
|
<span class="checkbox">
|
||||||
|
<%= t("account.show.email_digest_label") %>
|
||||||
|
</span>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
|
||||||
<%= f.submit t("account.show.save_changes_submit"), class: "button" %>
|
<%= f.submit t("account.show.save_changes_submit"), class: "button" %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ en:
|
|||||||
save_changes_submit: Save changes
|
save_changes_submit: Save changes
|
||||||
subscription_to_website_newsletter_label: Receive by email website relevant information
|
subscription_to_website_newsletter_label: Receive by email website relevant information
|
||||||
email_on_proposal_notification_label: Receive by email notifications about proposals
|
email_on_proposal_notification_label: Receive by email notifications about proposals
|
||||||
|
email_digest_label: Receive a summary of proposal notifications
|
||||||
title: My account
|
title: My account
|
||||||
user_permission_debates: Participate on debates
|
user_permission_debates: Participate on debates
|
||||||
user_permission_info: With your account you can...
|
user_permission_info: With your account you can...
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ es:
|
|||||||
save_changes_submit: Guardar cambios
|
save_changes_submit: Guardar cambios
|
||||||
subscription_to_website_newsletter_label: Recibir emails con información interesante sobre la web
|
subscription_to_website_newsletter_label: Recibir emails con información interesante sobre la web
|
||||||
email_on_proposal_notification_label: Recibir emails con notificaciones sobre propuestas
|
email_on_proposal_notification_label: Recibir emails con notificaciones sobre propuestas
|
||||||
|
email_digest_label: Recibir resumen de notificaciones sobre propuestas
|
||||||
title: Mi cuenta
|
title: Mi cuenta
|
||||||
user_permission_debates: Participar en debates
|
user_permission_debates: Participar en debates
|
||||||
user_permission_info: Con tu cuenta ya puedes...
|
user_permission_info: Con tu cuenta ya puedes...
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ feature 'Account' do
|
|||||||
check 'account_email_on_comment'
|
check 'account_email_on_comment'
|
||||||
check 'account_email_on_comment_reply'
|
check 'account_email_on_comment_reply'
|
||||||
uncheck 'account_email_on_proposal_notification'
|
uncheck 'account_email_on_proposal_notification'
|
||||||
|
uncheck 'account_email_digest'
|
||||||
click_button 'Save changes'
|
click_button 'Save changes'
|
||||||
|
|
||||||
expect(page).to have_content "Changes saved"
|
expect(page).to have_content "Changes saved"
|
||||||
@@ -45,7 +46,7 @@ feature 'Account' do
|
|||||||
expect(page).to have_selector("input[value='Larry Bird']")
|
expect(page).to have_selector("input[value='Larry Bird']")
|
||||||
expect(find("#account_email_on_comment")).to be_checked
|
expect(find("#account_email_on_comment")).to be_checked
|
||||||
expect(find("#account_email_on_comment_reply")).to be_checked
|
expect(find("#account_email_on_comment_reply")).to be_checked
|
||||||
expect(find("#account_email_on_proposal_notification")).to_not be_checked
|
expect(find("#account_email_digest")).to_not be_checked
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'Edit Organization' do
|
scenario 'Edit Organization' do
|
||||||
|
|||||||
@@ -89,6 +89,12 @@ describe User do
|
|||||||
expect(subject.email_on_proposal_notification).to eq(true)
|
expect(subject.email_on_proposal_notification).to eq(true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe 'email_digest' do
|
||||||
|
it 'should be true by default' do
|
||||||
|
expect(subject.email_digest).to eq(true)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "administrator?" do
|
describe "administrator?" do
|
||||||
|
|||||||
Reference in New Issue
Block a user