Skip to content

Commit d2fd090

Browse files
committed
feat: sort tags in dashboard API response
So the JSON bodies can be compared for differences
1 parent fc705a2 commit d2fd090

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/pact_broker/api/decorators/dashboard_decorator.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def verification_hash(index_item, base_url)
112112
end
113113

114114
def pact_tags(index_item, base_url)
115-
index_item.tag_names.collect do | tag_name |
115+
index_item.tag_names.sort.collect do | tag_name |
116116
fake_tag = OpenStruct.new(name: tag_name, version: index_item.consumer_version)
117117
{
118118
name: tag_name,
@@ -127,7 +127,7 @@ def pact_tags(index_item, base_url)
127127
end
128128

129129
def verification_tags(index_item, base_url)
130-
index_item.latest_verification_latest_tags.collect do | tag |
130+
index_item.latest_verification_latest_tags.sort{ |t1, t2| t1.name <=> t2.name }.collect do | tag |
131131
fake_tag = OpenStruct.new(name: tag.name, version: index_item.provider_version)
132132
{
133133
name: tag.name,

0 commit comments

Comments
 (0)