Remove Gitaly N+1 ignore from NotificationRecipientService spec
This was because we were creating projects unnecessarily. These should be set as the `source` for the notification setting, not the `project`!
This commit is contained in:
parent
b9b0fc8db1
commit
37a6be36e2
1 changed files with 4 additions and 4 deletions
|
@ -12,15 +12,15 @@ describe NotificationRecipientService do
|
||||||
|
|
||||||
def create_watcher
|
def create_watcher
|
||||||
watcher = create(:user)
|
watcher = create(:user)
|
||||||
create(:notification_setting, project: project, user: watcher, level: :watch)
|
create(:notification_setting, source: project, user: watcher, level: :watch)
|
||||||
|
|
||||||
other_projects.each do |other_project|
|
other_projects.each do |other_project|
|
||||||
create(:notification_setting, project: other_project, user: watcher, level: :watch)
|
create(:notification_setting, source: other_project, user: watcher, level: :watch)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'avoids N+1 queries', :request_store do
|
it 'avoids N+1 queries', :request_store do
|
||||||
Gitlab::GitalyClient.allow_n_plus_1_calls { create_watcher }
|
create_watcher
|
||||||
|
|
||||||
service.build_new_note_recipients(note)
|
service.build_new_note_recipients(note)
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ describe NotificationRecipientService do
|
||||||
service.build_new_note_recipients(note)
|
service.build_new_note_recipients(note)
|
||||||
end
|
end
|
||||||
|
|
||||||
Gitlab::GitalyClient.allow_n_plus_1_calls { create_watcher }
|
create_watcher
|
||||||
|
|
||||||
expect { service.build_new_note_recipients(note) }.not_to exceed_query_limit(control_count)
|
expect { service.build_new_note_recipients(note) }.not_to exceed_query_limit(control_count)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue