Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/serializers/profile/event_entity_spec.rb')
-rw-r--r--spec/serializers/profile/event_entity_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/serializers/profile/event_entity_spec.rb b/spec/serializers/profile/event_entity_spec.rb
index b1246e7e47d..3dade4210b3 100644
--- a/spec/serializers/profile/event_entity_spec.rb
+++ b/spec/serializers/profile/event_entity_spec.rb
@@ -153,6 +153,17 @@ RSpec.describe Profile::EventEntity, feature_category: :user_profile do
end
end
+ context 'without target' do
+ let(:event) do
+ build(:event, :destroyed, author: user, project: project, target_type: Milestone.to_s)
+ end
+
+ it 'only exposes target.type' do
+ expect(subject[:target][:type]).to eq(Milestone.to_s)
+ expect(subject[:target]).not_to include(:web_url)
+ end
+ end
+
context 'with resource parent' do
it 'exposes resource parent fields' do
resource_parent = event.resource_parent