Skip to content

Commit

Permalink
feat: sort tags in dashboard API response
Browse files Browse the repository at this point in the history
So the JSON bodies can be compared for differences
  • Loading branch information
bethesque committed Mar 30, 2018
1 parent fc705a2 commit d2fd090
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/pact_broker/api/decorators/dashboard_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def verification_hash(index_item, base_url)
end

def pact_tags(index_item, base_url)
index_item.tag_names.collect do | tag_name |
index_item.tag_names.sort.collect do | tag_name |
fake_tag = OpenStruct.new(name: tag_name, version: index_item.consumer_version)
{
name: tag_name,
Expand All @@ -127,7 +127,7 @@ def pact_tags(index_item, base_url)
end

def verification_tags(index_item, base_url)
index_item.latest_verification_latest_tags.collect do | tag |
index_item.latest_verification_latest_tags.sort{ |t1, t2| t1.name <=> t2.name }.collect do | tag |
fake_tag = OpenStruct.new(name: tag.name, version: index_item.provider_version)
{
name: tag.name,
Expand Down

0 comments on commit d2fd090

Please sign in to comment.