Class: PactBroker::Api::Resources::ErrorTest

Inherits:
BaseResource
  • Object
show all
Defined in:
lib/pact_broker/api/resources/error_test.rb

Instance Method Summary collapse

Instance Method Details

#allowed_methodsObject



14
15
16
# File 'lib/pact_broker/api/resources/error_test.rb', line 14

def allowed_methods
  ["GET", "POST", "OPTIONS"]
end

#content_types_providedObject



8
9
10
11
12
# File 'lib/pact_broker/api/resources/error_test.rb', line 8

def content_types_provided
  [
    ["application/hal+json", :to_json]
  ]
end

#policy_nameObject



26
27
28
# File 'lib/pact_broker/api/resources/error_test.rb', line 26

def policy_name
  :'default'
end

#process_postObject



22
23
24
# File 'lib/pact_broker/api/resources/error_test.rb', line 22

def process_post
  raise PactBroker::TestError.new("Don't panic. This is a test API error.")
end

#to_jsonObject



18
19
20
# File 'lib/pact_broker/api/resources/error_test.rb', line 18

def to_json
  raise PactBroker::TestError.new("Don't panic. This is a test API error.")
end