DEV: Use proper wording for contexts in specs

This commit is contained in:
Loïc Guitaut
2022-07-27 18:14:14 +02:00
committed by Loïc Guitaut
parent 02987e05d5
commit 3eaac56797
337 changed files with 2172 additions and 2723 deletions

View File

@ -15,7 +15,7 @@ RSpec.describe Notification do
it { is_expected.to belong_to :topic }
describe '#types' do
context "verify enum sequence" do
context "when verifying enum sequence" do
before do
@types = Notification.types
end
@ -109,7 +109,6 @@ RSpec.describe Notification do
}.not_to change(user.notifications, :count)
end
end
end
describe 'high priority creation' do
@ -131,10 +130,9 @@ RSpec.describe Notification do
end
describe 'unread counts' do
fab!(:user) { Fabricate(:user) }
context 'a regular notification' do
context 'with a regular notification' do
it 'increases unread_notifications' do
expect { Fabricate(:notification, user: user); user.reload }.to change(user, :unread_notifications)
end
@ -148,7 +146,7 @@ RSpec.describe Notification do
end
end
context 'a private message' do
context 'with a private message' do
it "doesn't increase unread_notifications" do
expect { Fabricate(:private_message_notification, user: user); user.reload }.not_to change(user, :unread_notifications)
end
@ -166,7 +164,7 @@ RSpec.describe Notification do
end
end
context 'a bookmark reminder message' do
context 'with a bookmark reminder message' do
it "doesn't increase unread_notifications" do
expect { Fabricate(:bookmark_reminder_notification, user: user); user.reload }.not_to change(user, :unread_notifications)
end
@ -179,7 +177,6 @@ RSpec.describe Notification do
expect { Fabricate(:bookmark_reminder_notification, user: user); user.reload }.to change(user, :unread_high_priority_notifications)
end
end
end
describe 'message bus' do
@ -209,7 +206,7 @@ RSpec.describe Notification do
partial_user.notifications.create!(notification_type: Notification.types[:mentioned], data: '{}')
end
context 'destroy' do
context 'when destroying' do
let!(:notification) { Fabricate(:notification) }
it 'updates the notification count on destroy' do