mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 09:08:10 +08:00
FIX: 'disable_edit_notifications' will only disable revisions made by the system user
This commit is contained in:
@ -40,11 +40,23 @@ describe PostAlertObserver do
|
||||
}.should change(post.user.notifications, :count).by(1)
|
||||
end
|
||||
|
||||
it 'does not notifiy a user of the revision when edit notifications are disabled' do
|
||||
SiteSetting.stubs(:disable_edit_notifications).returns(true)
|
||||
lambda {
|
||||
post.revise(evil_trout, "world is the new body of the message")
|
||||
}.should_not change(post.user.notifications, :count).by(1)
|
||||
context "edit notifications are disabled" do
|
||||
|
||||
before { SiteSetting.stubs(:disable_edit_notifications).returns(true) }
|
||||
|
||||
|
||||
it 'notifies a user of the revision made by another user' do
|
||||
lambda {
|
||||
post.revise(evil_trout, "world is the new body of the message")
|
||||
}.should change(post.user.notifications, :count).by(1)
|
||||
end
|
||||
|
||||
it 'does not notifiy a user of the revision made by the system user' do
|
||||
lambda {
|
||||
post.revise(Discourse.system_user, "world is the new body of the message")
|
||||
}.should_not change(post.user.notifications, :count)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user