Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Add /api/v3/activities/:id emoji reaction embed request spec

Kabiru Mwenjaf2a82f63a1b1
diff --git a/spec/requests/api/v3/activities_api_spec.rb b/spec/requests/api/v3/activities_api_spec.rb
index 20114757051..9c97193b06e 100644
--- a/spec/requests/api/v3/activities_api_spec.rb
+++ b/spec/requests/api/v3/activities_api_spec.rb
@@ -216,6 +216,24 @@ RSpec.describe API::V3::Activities::ActivitiesAPI, content_type: :json do
end
it_behaves_like "valid activity request", "Activity::Comment"
+
+ context "and an emoji reaction" do
+ let!(:emoji_reaction) do
+ create(:emoji_reaction, reactable: activity, user: current_user)
+ end
+
+ it "returns the emoji reactions" do
+ get get_path
+
+ expect(last_response.body)
+ .to be_json_eql("#{activity.id}-#{emoji_reaction.reaction}".to_json)
+ .at_path("_embedded/emojiReactions/_embedded/elements/0/id")
+
+ expect(last_response.body)
+ .to be_json_eql(emoji_reaction.emoji.to_json)
+ .at_path("_embedded/emojiReactions/_embedded/elements/0/emoji")
+ end
+ end
end
context "for a internal journal" do