summaryrefslogtreecommitdiff
path: root/spec/services
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2018-10-25 18:12:12 +0200
committerBob Van Landuyt <bob@vanlanduyt.co>2018-10-25 18:20:23 +0200
commit7a525004a7c9fa7b5a4d11ec5f8bf7854519178c (patch)
tree5d5110d96c7cf1fb3e1fce6de63b6066e31b4528 /spec/services
parent9e6098a6db3fd99f1c156b81598476b9df286f60 (diff)
downloadgitlab-ce-7a525004a7c9fa7b5a4d11ec5f8bf7854519178c.tar.gz
Preload user status for label events
This makes sure the user_status for the user of a label event is preloaded. Otherwise it would not be rendered in the fake system note.
Diffstat (limited to 'spec/services')
-rw-r--r--spec/services/resource_events/merge_into_notes_service_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/services/resource_events/merge_into_notes_service_spec.rb b/spec/services/resource_events/merge_into_notes_service_spec.rb
index 0d333d541c9..c76f6e6f77e 100644
--- a/spec/services/resource_events/merge_into_notes_service_spec.rb
+++ b/spec/services/resource_events/merge_into_notes_service_spec.rb
@@ -66,5 +66,14 @@ describe ResourceEvents::MergeIntoNotesService do
expect(notes.count).to eq 1
expect(notes.first.discussion_id).to eq event.discussion_id
end
+
+ it "preloads the note author's status" do
+ event = create_event(created_at: time)
+ create(:user_status, user: event.user)
+
+ notes = described_class.new(resource, user).execute
+
+ expect(notes.first.author.association(:status)).to be_loaded
+ end
end
end