Commit b3720b7f authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch '322901-fix-pagerduty-webhook' into 'master'

Fix: No such file or directory for pager_duty/validator

See merge request gitlab-org/gitlab!55725
parents ee52f8b4 7dcb21ee
---
title: 'Fixes: No such file or directory lib/pager_duty/validator/schemas/message.json'
merge_request: 55725
author:
type: fixed
......@@ -2,7 +2,7 @@
module PagerDuty
class WebhookPayloadParser
SCHEMA_PATH = File.join('lib', 'pager_duty', 'validator', 'schemas', 'message.json')
SCHEMA_PATH = Rails.root.join('lib', 'pager_duty', 'validator', 'schemas', 'message.json')
def initialize(payload)
@payload = payload
......@@ -66,7 +66,7 @@ module PagerDuty
end
def valid_message?(message)
::JSONSchemer.schema(Pathname.new(SCHEMA_PATH)).valid?(message)
::JSONSchemer.schema(SCHEMA_PATH).valid?(message)
end
end
end
# frozen_string_literal: true
require 'fast_spec_helper'
require 'json_schemer'
require 'spec_helper'
RSpec.describe PagerDuty::WebhookPayloadParser do
describe '.call' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment