Replace all option in parsing representer with 'real' setting

pull/9665/head
Oliver Günther 3 years ago
parent 15febf16d0
commit 2d6289d8a7
No known key found for this signature in database
GPG Key ID: 88872239EB414F99
  1. 2
      app/models/notifications/scopes/mail_alert_unsent.rb
  2. 4
      modules/documents/spec/services/notifications/create_from_model_service_document_spec.rb
  3. 9
      spec/lib/api/v3/user_preferences/user_preference_representer_parsing_spec.rb
  4. 0
      spec/models/notifications/scopes/reminder_mail_unsent_spec.rb
  5. 2
      spec/services/notifications/create_from_model_service_work_package_spec.rb

@ -35,7 +35,7 @@ module Notifications::Scopes
class_methods do
def mail_alert_unsent
where(mail_alert_unsent: false)
where(mail_alert_sent: false)
end
end
end

@ -72,7 +72,7 @@ describe Notifications::CreateFromModelService, 'document', with_settings: { jou
context 'with the user having registered for involved notifications' do
let(:recipient_notification_settings) do
[
FactoryBot.build(:notification_setting, **notification_settings_all_false.merge(involved: true)),
FactoryBot.build(:notification_setting, **notification_settings_all_false.merge(involved: true))
]
end
@ -82,7 +82,7 @@ describe Notifications::CreateFromModelService, 'document', with_settings: { jou
context 'with the user having registered for no notifications' do
let(:recipient_notification_settings) do
[
FactoryBot.build(:notification_setting, **notification_settings_all_false),
FactoryBot.build(:notification_setting, **notification_settings_all_false)
]
end

@ -43,7 +43,7 @@ describe ::API::V3::UserPreferences::UserPreferenceRepresenter,
{
'notifications' => [
{
'all' => true,
'involved' => true,
'_links' => {
'project' => {
'href' => '/api/v3/projects/1'
@ -51,7 +51,7 @@ describe ::API::V3::UserPreferences::UserPreferenceRepresenter,
}
},
{
'all' => false,
'involved' => false,
'mentioned' => true,
'_links' => {
'project' => {
@ -69,10 +69,11 @@ describe ::API::V3::UserPreferences::UserPreferenceRepresenter,
in_project, global = subject.notification_settings
expect(in_project[:project_id]).to eq "1"
expect(in_project[:all]).to be_truthy
expect(in_project[:involved]).to be_truthy
expect(in_project[:mentioned]).to be_nil
expect(global[:project_id]).to eq nil
expect(global[:all]).to eq false
expect(global[:involved]).to eq false
expect(global[:mentioned]).to eq true
end
end

@ -299,7 +299,7 @@ describe Notifications::CreateFromModelService,
let(:user_property) { :watcher }
let(:recipient_notification_settings) do
[
FactoryBot.build(:notification_setting, **notification_settings_all_true),
FactoryBot.build(:notification_setting, **notification_settings_all_true)
]
end

Loading…
Cancel
Save