Skip to content

Commit

Permalink
feat: add timestamps to version resource
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Jul 30, 2020
1 parent a82e4fb commit 818a0c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/pact_broker/api/decorators/version_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ class VersionDecorator < BaseDecorator

collection :tags, embedded: true, :extend => PactBroker::Api::Decorators::EmbeddedTagDecorator

include Timestamps

link :self do | options |
{
title: 'Version',
Expand Down
4 changes: 4 additions & 0 deletions spec/lib/pact_broker/api/decorators/version_decorator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ module Decorators
expect(subject[:_embedded][:tags].first[:name]).to eq "prod"
end

it "includes the timestamps" do
expect(subject[:createdAt]).to_not be nil
end

it "includes a list of sorted pacts" do
expect(subject[:_links][:'pb:pact-versions']).to be_instance_of(Array)
expect(subject[:_links][:'pb:pact-versions'].first[:href]).to include ("1.2.3")
Expand Down

0 comments on commit 818a0c2

Please sign in to comment.