From 4af4ed1c659f5ea67671914c1aadc5276e211096 Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Thu, 23 Aug 2018 20:27:13 +1000 Subject: [PATCH] fix: correct :false to false in verification decorator to correctly handle read only property providerName --- lib/pact_broker/api/decorators/verification_decorator.rb | 2 +- .../pact_broker/api/decorators/verification_decorator_spec.rb | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/pact_broker/api/decorators/verification_decorator.rb b/lib/pact_broker/api/decorators/verification_decorator.rb index c09a0440b..15df3d1a4 100644 --- a/lib/pact_broker/api/decorators/verification_decorator.rb +++ b/lib/pact_broker/api/decorators/verification_decorator.rb @@ -5,7 +5,7 @@ module Api module Decorators class VerificationDecorator < BaseDecorator - property :provider_name, as: :providerName, writeable: :false + property :provider_name, as: :providerName, writeable: false property :provider_version_number, as: :providerApplicationVersion, writeable: false property :success property :execution_date, as: :verificationDate diff --git a/spec/lib/pact_broker/api/decorators/verification_decorator_spec.rb b/spec/lib/pact_broker/api/decorators/verification_decorator_spec.rb index 82e7a735a..6f51acd0f 100644 --- a/spec/lib/pact_broker/api/decorators/verification_decorator_spec.rb +++ b/spec/lib/pact_broker/api/decorators/verification_decorator_spec.rb @@ -34,7 +34,9 @@ module Decorators let(:options) { { user_options: { base_url: 'http://example.org' } } } - subject { JSON.parse VerificationDecorator.new(verification).to_json(options), symbolize_names: true } + let(:json) { VerificationDecorator.new(verification).to_json(options) } + + subject { JSON.parse json, symbolize_names: true } it "includes the success status" do expect(subject[:success]).to eq true