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



16
17
18
# File 'lib/pact_broker/api/resources/error_test.rb', line 16

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

#content_types_providedObject



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

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

#process_postObject



24
25
26
# File 'lib/pact_broker/api/resources/error_test.rb', line 24

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

#to_jsonObject



20
21
22
# File 'lib/pact_broker/api/resources/error_test.rb', line 20

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