Skip to content

Commit

Permalink
Merge pull request #18035 from kbrock/monitor_notifier_fix
Browse files Browse the repository at this point in the history
Fix Notifications None

(cherry picked from commit 8489078)

https://bugzilla.redhat.com/show_bug.cgi?id=1535177
  • Loading branch information
bdunne authored and simaishi committed Oct 1, 2018
1 parent 28ab017 commit 33aa42d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/notification_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class NotificationType < ApplicationRecord
validates :level, :inclusion => { :in => %w(success error warning info) }
validates :link_to, :inclusion => { :in => %w(subject initiator cause) }, :allow_blank => true
validates :audience, :inclusion => {
:in => [AUDIENCE_USER, AUDIENCE_GROUP, AUDIENCE_TENANT, AUDIENCE_GLOBAL, AUDIENCE_SUPERADMIN]
:in => [AUDIENCE_USER, AUDIENCE_GROUP, AUDIENCE_TENANT, AUDIENCE_GLOBAL, AUDIENCE_SUPERADMIN, AUDIENCE_NONE]
}

def subscriber_ids(subject, initiator)
Expand Down
8 changes: 8 additions & 0 deletions spec/models/notification_type_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,12 @@
end
end
end

describe "#enabled?" do
it "detects properly" do
expect(FactoryGirl.build(:notification_type, :audience => NotificationType::AUDIENCE_USER)).to be_enabled
expect(FactoryGirl.build(:notification_type, :audience => NotificationType::AUDIENCE_NONE)).not_to be_enabled
expect(FactoryGirl.build(:notification_type, :audience => NotificationType::AUDIENCE_NONE)).to be_valid
end
end
end

0 comments on commit 33aa42d

Please sign in to comment.